/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef DEBUG
#define DEBUG
#define _SYS_DEBUG_H
#else
#define _SYS_DEBUG_H
#endif
#include <sys/traptrace.h>
#include <sys/machparam.h>
#include <sys/mutex_impl.h>
#include <mdb/mdb_modapi.h>
#include <mdb/mdb_whatis.h>
#include "sfmmu.h"
#ifndef SYSTRAP_TT
#endif
typedef struct trap_trace_fullrec {
int ttf_cpu;
#ifdef sun4v
typedef struct htrap_trace_fullrec {
int ttf_cpu;
#endif
/*
* These strings and accompanying macros allow our string table to look
* just like the real table in trap_table.s.
*/
static const char *const ttdescr[] = {
NOT, /* 000 reserved */
"power-on", /* 001 power on reset */
"watchdog", /* 002 watchdog reset */
"xir", /* 003 externally initiated reset */
"sir", /* 004 software initiated reset */
"red", /* 005 red mode exception */
"immu-xcp", /* 008 instruction access exception */
"immu-miss", /* 009 instruction access MMU miss */
"immu-err", /* 00A instruction access error */
"ill-inst", /* 010 illegal instruction */
"priv-inst", /* 011 privileged opcode */
"unimp-ldd", /* 012 unimplemented LDD */
"unimp-std", /* 013 unimplemented STD */
"fp-disable", /* 020 fp disabled */
"fp-ieee754", /* 021 fp exception ieee 754 */
"fp-xcp-other", /* 022 fp exception other */
"tag-oflow", /* 023 tag overflow */
"cleanwin", /* 024 clean window */
"cleanwin", /* 025 clean window */
"cleanwin", /* 026 clean window */
"cleanwin", /* 027 clean window */
"div-zero", /* 028 division by zero */
"internal-err", /* 029 internal processor error */
"dmmu-xcp", /* 030 data access exception */
"dmmu-miss", /* 031 data access MMU miss */
"dmmu-err", /* 032 data access error */
"dmmu-prot", /* 033 data access protection */
"unalign", /* 034 mem address not aligned */
"lddf-unalign", /* 035 LDDF mem address not aligned */
"stdf-unalign", /* 036 STDF mem address not aligned */
"priv-act", /* 037 privileged action */
"ldqf-unalign", /* 038 LDQF mem address not aligned */
"stqf-unalign", /* 039 STQF mem address not aligned */
"async-d-err", /* 040 async data error */
"level-1", /* 041 interrupt level 1 */
"level-2", /* 042 interrupt level 2 */
"level-3", /* 043 interrupt level 3 */
"level-4", /* 044 interrupt level 4 */
"level-5", /* 045 interrupt level 5 */
"level-6", /* 046 interrupt level 6 */
"level-7", /* 047 interrupt level 7 */
"level-8", /* 048 interrupt level 8 */
"level-9", /* 049 interrupt level 9 */
"level-10", /* 04A interrupt level 10 */
"level-11", /* 04B interrupt level 11 */
"level-12", /* 04C interrupt level 12 */
"level-13", /* 04D interrupt level 13 */
"level-14", /* 04E interrupt level 14 */
"level-15", /* 04F interrupt level 15 */
"int-vec", /* 060 interrupt vector */
"pa-watch", /* 061 PA watchpoint */
"va-watch", /* 062 VA watchpoint */
"ecc-err", /* 063 corrected ECC error */
"itlb-miss", /* 064 instruction access MMU miss */
"itlb-miss", /* 065 instruction access MMU miss */
"itlb-miss", /* 066 instruction access MMU miss */
"itlb-miss", /* 067 instruction access MMU miss */
"dtlb-miss", /* 068 data access MMU miss */
"dtlb-miss", /* 069 data access MMU miss */
"dtlb-miss", /* 06A data access MMU miss */
"dtlb-miss", /* 06B data access MMU miss */
"dtlb-prot", /* 06C data access protection */
"dtlb-prot", /* 06D data access protection */
"dtlb-prot", /* 06E data access protection */
"dtlb-prot", /* 06F data access protection */
"fast-ecc-err", /* 070 fast ecache ECC error */
"dp-err", /* 071 data cache parity error */
"ip-err", /* 072 instr cache parity error */
#ifdef sun4v
"cpu-mondo", /* 07C CPU mondo */
"dev-mondo", /* 07D device mondo */
"res.-err", /* 07E resumable error */
"non-res.-err", /* 07F non-resumable error */
#else
NOT4, /* 07C - 07F reserved */
#endif
"spill-0-norm", /* 080 spill 0 normal */
"spill-0-norm", /* 081 spill 0 normal */
"spill-0-norm", /* 082 spill 0 normal */
"spill-0-norm", /* 083 spill 0 normal */
"spill-1-norm", /* 084 spill 1 normal */
"spill-1-norm", /* 085 spill 1 normal */
"spill-1-norm", /* 086 spill 1 normal */
"spill-1-norm", /* 087 spill 1 normal */
"spill-2-norm", /* 088 spill 2 normal */
"spill-2-norm", /* 089 spill 2 normal */
"spill-2-norm", /* 08A spill 2 normal */
"spill-2-norm", /* 08B spill 2 normal */
"spill-3-norm", /* 08C spill 3 normal */
"spill-3-norm", /* 08D spill 3 normal */
"spill-3-norm", /* 08E spill 3 normal */
"spill-3-norm", /* 08F spill 3 normal */
"spill-4-norm", /* 090 spill 4 normal */
"spill-4-norm", /* 091 spill 4 normal */
"spill-4-norm", /* 092 spill 4 normal */
"spill-4-norm", /* 093 spill 4 normal */
"spill-5-norm", /* 094 spill 5 normal */
"spill-5-norm", /* 095 spill 5 normal */
"spill-5-norm", /* 096 spill 5 normal */
"spill-5-norm", /* 097 spill 5 normal */
"spill-6-norm", /* 098 spill 6 normal */
"spill-6-norm", /* 099 spill 6 normal */
"spill-6-norm", /* 09A spill 6 normal */
"spill-6-norm", /* 09B spill 6 normal */
"spill-7-norm", /* 09C spill 7 normal */
"spill-7-norm", /* 09D spill 7 normal */
"spill-7-norm", /* 09E spill 7 normal */
"spill-7-norm", /* 09F spill 7 normal */
"spill-0-oth", /* 0A0 spill 0 other */
"spill-0-oth", /* 0A1 spill 0 other */
"spill-0-oth", /* 0A2 spill 0 other */
"spill-0-oth", /* 0A3 spill 0 other */
"spill-1-oth", /* 0A4 spill 1 other */
"spill-1-oth", /* 0A5 spill 1 other */
"spill-1-oth", /* 0A6 spill 1 other */
"spill-1-oth", /* 0A7 spill 1 other */
"spill-2-oth", /* 0A8 spill 2 other */
"spill-2-oth", /* 0A9 spill 2 other */
"spill-2-oth", /* 0AA spill 2 other */
"spill-2-oth", /* 0AB spill 2 other */
"spill-3-oth", /* 0AC spill 3 other */
"spill-3-oth", /* 0AD spill 3 other */
"spill-3-oth", /* 0AE spill 3 other */
"spill-3-oth", /* 0AF spill 3 other */
"spill-4-oth", /* 0B0 spill 4 other */
"spill-4-oth", /* 0B1 spill 4 other */
"spill-4-oth", /* 0B2 spill 4 other */
"spill-4-oth", /* 0B3 spill 4 other */
"spill-5-oth", /* 0B4 spill 5 other */
"spill-5-oth", /* 0B5 spill 5 other */
"spill-5-oth", /* 0B6 spill 5 other */
"spill-5-oth", /* 0B7 spill 5 other */
"spill-6-oth", /* 0B8 spill 6 other */
"spill-6-oth", /* 0B9 spill 6 other */
"spill-6-oth", /* 0BA spill 6 other */
"spill-6-oth", /* 0BB spill 6 other */
"spill-7-oth", /* 0BC spill 7 other */
"spill-7-oth", /* 0BD spill 7 other */
"spill-7-oth", /* 0BE spill 7 other */
"spill-7-oth", /* 0BF spill 7 other */
"fill-0-norm", /* 0C0 fill 0 normal */
"fill-0-norm", /* 0C1 fill 0 normal */
"fill-0-norm", /* 0C2 fill 0 normal */
"fill-0-norm", /* 0C3 fill 0 normal */
"fill-1-norm", /* 0C4 fill 1 normal */
"fill-1-norm", /* 0C5 fill 1 normal */
"fill-1-norm", /* 0C6 fill 1 normal */
"fill-1-norm", /* 0C7 fill 1 normal */
"fill-2-norm", /* 0C8 fill 2 normal */
"fill-2-norm", /* 0C9 fill 2 normal */
"fill-2-norm", /* 0CA fill 2 normal */
"fill-2-norm", /* 0CB fill 2 normal */
"fill-3-norm", /* 0CC fill 3 normal */
"fill-3-norm", /* 0CD fill 3 normal */
"fill-3-norm", /* 0CE fill 3 normal */
"fill-3-norm", /* 0CF fill 3 normal */
"fill-4-norm", /* 0D0 fill 4 normal */
"fill-4-norm", /* 0D1 fill 4 normal */
"fill-4-norm", /* 0D2 fill 4 normal */
"fill-4-norm", /* 0D3 fill 4 normal */
"fill-5-norm", /* 0D4 fill 5 normal */
"fill-5-norm", /* 0D5 fill 5 normal */
"fill-5-norm", /* 0D6 fill 5 normal */
"fill-5-norm", /* 0D7 fill 5 normal */
"fill-6-norm", /* 0D8 fill 6 normal */
"fill-6-norm", /* 0D9 fill 6 normal */
"fill-6-norm", /* 0DA fill 6 normal */
"fill-6-norm", /* 0DB fill 6 normal */
"fill-7-norm", /* 0DC fill 7 normal */
"fill-7-norm", /* 0DD fill 7 normal */
"fill-7-norm", /* 0DE fill 7 normal */
"fill-7-norm", /* 0DF fill 7 normal */
"fill-0-oth", /* 0E0 fill 0 other */
"fill-0-oth", /* 0E1 fill 0 other */
"fill-0-oth", /* 0E2 fill 0 other */
"fill-0-oth", /* 0E3 fill 0 other */
"fill-1-oth", /* 0E4 fill 1 other */
"fill-1-oth", /* 0E5 fill 1 other */
"fill-1-oth", /* 0E6 fill 1 other */
"fill-1-oth", /* 0E7 fill 1 other */
"fill-2-oth", /* 0E8 fill 2 other */
"fill-2-oth", /* 0E9 fill 2 other */
"fill-2-oth", /* 0EA fill 2 other */
"fill-2-oth", /* 0EB fill 2 other */
"fill-3-oth", /* 0EC fill 3 other */
"fill-3-oth", /* 0ED fill 3 other */
"fill-3-oth", /* 0EE fill 3 other */
"fill-3-oth", /* 0EF fill 3 other */
"fill-4-oth", /* 0F0 fill 4 other */
"fill-4-oth", /* 0F1 fill 4 other */
"fill-4-oth", /* 0F2 fill 4 other */
"fill-4-oth", /* 0F3 fill 4 other */
"fill-5-oth", /* 0F4 fill 5 other */
"fill-5-oth", /* 0F5 fill 5 other */
"fill-5-oth", /* 0F6 fill 5 other */
"fill-5-oth", /* 0F7 fill 5 other */
"fill-6-oth", /* 0F8 fill 6 other */
"fill-6-oth", /* 0F9 fill 6 other */
"fill-6-oth", /* 0FA fill 6 other */
"fill-6-oth", /* 0FB fill 6 other */
"fill-7-oth", /* 0FC fill 7 other */
"fill-7-oth", /* 0FD fill 7 other */
"fill-7-oth", /* 0FE fill 7 other */
"fill-7-oth", /* 0FF fill 7 other */
"syscall-4x", /* 100 old system call */
"usr-brkpt", /* 101 user breakpoint */
"usr-div-zero", /* 102 user divide by zero */
"flush-wins", /* 103 flush windows */
"clean-wins", /* 104 clean windows */
"range-chk", /* 105 range check ?? */
"fix-align", /* 106 do unaligned references */
BAD, /* 107 unused */
"syscall-32", /* 108 ILP32 system call on LP64 */
"set-t0-addr", /* 109 set trap0 address */
"get-cc", /* 120 get condition codes */
"set-cc", /* 121 set condition codes */
"get-psr", /* 122 get psr */
"set-psr", /* 123 set psr (some fields) */
"getts", /* 124 get timestamp */
"gethrvtime", /* 125 get lwp virtual time */
"self-xcall", /* 126 self xcall */
"gethrtime", /* 127 get hrestime */
BAD, /* 128 unused (ST_SETV9STACK) */
"getlgrp", /* 129 get lgrpid */
"dtrace-pid", /* 138 DTrace pid provider */
BAD, /* 139 unused */
"dtrace-return", /* 13A DTrace pid provider */
"syscall-64", /* 140 LP64 system call */
BAD, /* 141 unused */
"tt-freeze", /* 142 freeze traptrace */
"tt-unfreeze", /* 143 unfreeze traptrace */
"ptl1-panic", /* 17C test ptl1_panic */
"kmdb-enter", /* 17D kmdb enter (L1-A) */
"kmdb-brkpt", /* 17E kmdb breakpoint */
"obp-brkpt", /* 17F obp breakpoint */
#ifdef sun4v
"fast_trap", /* 180 hypervisor fast trap */
"cpu_tick_npt", /* 181 cpu_tick_npt() hcall */
"cpu_stick_npt", /* 182 cpu_stick_npt() hcall */
"mmu_map_addr", /* 183 mmu_map_addr() hcall */
"mmu_unmap_addr", /* 184 mmu_unmap_addr() hcall */
"ttrace_addentry", /* 185 ttrace_addentry() hcall */
#else
#endif
};
/*
* Persistent data (shouldn't change).
*/
static int
fetch_ncpu(void)
{
if (ncpu == 0)
mdb_warn("symbol '_ncpu' not found");
return (1);
}
return (0);
}
static int
fetch_mbox(void)
{
if (mbox_size <= 0) {
mdb_warn("couldn't find type 'struct xc_mbox'");
return (1);
}
/*
* These two could be combined into a single call to
* mdb_ctf_member_info if xc_state was actually of type
* enum xc_states.
*/
if (mdb_ctf_lookup_by_name("enum xc_states",
&mbox_states) == -1) {
mdb_warn("couldn't find type 'enum xc_states'");
return (1);
}
mdb_warn("couldn't find 'xc_mbox.xc_state'");
return (1);
}
mbox_stoff /= NBBY;
mdb_warn("couldn't size 'struct xc_mbox'");
return (1);
}
}
return (0);
}
static int
{
int count;
char tmp;
char *format;
/* Unfortunately, mdb_printf returns void */
} else {
}
return (count);
}
static void
{
int i, j;
ulong_t m;
int in = 0;
int start;
int end;
int count = 0;
int sep = 0;
for (i = 0; i < words; i++)
if (cs[i] & m) {
if (in == 0) {
in = 1;
}
} else {
if (in == 1) {
sep = 1;
in = 0;
}
}
if (in == 1) {
}
mdb_printf(" ");
}
/*ARGSUSED*/
static int
{
int words;
return (DCMD_USAGE);
return (DCMD_USAGE);
if (fetch_ncpu())
return (DCMD_ERR);
} else {
}
if (lflag) {
int i, j;
ulong_t m;
for (i = 0; i < words; i++)
if (setp[i] & m)
} else if (rflag) {
int i;
int sep = 0;
for (i = 0; i < words; i++) {
sep = 1;
}
} else {
}
return (DCMD_OK);
}
/*ARGSUSED*/
int
{
int i, traptrace_buf_inuse = 0;
if (argc != 0)
return (DCMD_USAGE);
if (fetch_ncpu())
return (DCMD_ERR);
"trap_trace_ctl") == -1) {
mdb_warn("symbol 'trap_trace_ctl' not found");
return (DCMD_ERR);
}
if (ctl->d.vaddr_base == 0)
continue;
traptrace_buf_inuse = 1;
mdb_printf("trap_trace_ctl[%d] = {\n", i);
}
if (!traptrace_buf_inuse) {
mdb_warn("traptrace not configured");
return (DCMD_ERR);
}
return (DCMD_OK);
}
/*ARGSUSED*/
static int
{
const char *ttstr;
if (*cpu == -1)
else
return (0);
/*
* Decoding the traptype field is a bit messy. First we check for
* several well-defined 16-bit values defined in <sys/traptrace.h>.
*/
case TT_SC_ENTR:
ttstr = "sys-enter";
break;
case TT_SC_RET:
ttstr = "sys-exit";
break;
case TT_SYS_RTT_PROM:
ttstr = "prom_rtt";
break;
case TT_SYS_RTT_PRIV:
ttstr = "priv_rtt";
break;
case TT_SYS_RTT_USER:
ttstr = "user_rtt";
break;
case TT_INTR_EXIT:
ttstr = "int-thr-exit";
break;
default:
/*
* Next we consider several prefixes (which are
* typically OR'd with other information such as the
* %pil or %tt value at the time of the trace).
*/
case TT_SERVE_INTR:
ttstr = "serve-intr";
break;
case TT_XCALL:
ttstr = "xcall";
break;
case TT_XCALL_CONT:
ttstr = "xcall-cont";
break;
case SYSTRAP_TT:
ttstr = "sys_trap";
break;
default:
/*
* Otherwise we try to convert the
* tt value to a string using our
* giant lookup table.
*/
}
}
#ifdef sun4v
#else
#endif
return (WALK_NEXT);
}
/*ARGSUSED*/
static int
{
if (*cpu == -1)
return (WALK_NEXT);
#ifdef sun4v
mdb_printf("%016llx %016llx %04hx %02x %02x %0?p %0?p %0?p "
"[%p,%p,%p,%p]\n",
#else
mdb_printf("%016llx %016llx %04hx %04hx %0?p %0?p %0?p [%p,%p,%p,%p]\n",
#endif
return (WALK_NEXT);
}
typedef struct ttrace_cpu_data {
typedef struct ttrace_walk_data {
int tw_ncpu;
int
{
int i, traptrace_buf_inuse = 0;
mdb_warn("ttrace only supports global walks\n");
return (WALK_ERR);
}
if (fetch_ncpu())
return (WALK_ERR);
"trap_trace_ctl") == -1) {
mdb_warn("symbol 'trap_trace_ctl' not found");
return (WALK_ERR);
}
for (i = 0; i < ncpu; i++) {
if (ctl->d.vaddr_base == 0)
continue;
traptrace_buf_inuse = 1;
sizeof (struct trap_trace_record);
mdb_warn("failed to read trap trace buffer at %p",
ctl->d.vaddr_base);
} else {
}
}
if (!traptrace_buf_inuse) {
mdb_warn("traptrace not configured");
return (DCMD_ERR);
}
return (WALK_NEXT);
}
int
{
continue;
done = 0;
mdb_warn("Warning: tt_tick == 0\n");
oldest = i;
}
}
if (done)
return (-1);
if (oldest_tick != 0)
wsp->walk_cbdata);
sizeof (struct trap_trace_record));
}
return (status);
}
void
{
}
int
{
return (DCMD_USAGE);
if (flags & DCMD_ADDRSPEC) {
if (fetch_ncpu())
return (DCMD_ERR);
return (DCMD_ERR);
}
}
if (cpu == -1)
mdb_printf("CPU ");
if (opt_x) {
#ifdef sun4v
mdb_printf("%-16s %-16s %-4s %-3s %-3s %-?s %-?s %-?s "
"F1-4\n", "%tick", "%tstate", "%tt", "%tl", "%gl",
"%tpc", "%sp", "TR");
#else
mdb_printf("%-16s %-16s %-4s %-4s %-?s %-?s %-?s "
"F1-4\n", "%tick", "%tstate", "%tt", "%tl",
"%tpc", "%sp", "TR");
#endif
} else {
#ifdef sun4v
mdb_printf("%-16s %-4s %-12s %-3s %-3s %s\n",
"%tick", "%tt", "", "%tl", "%gl", "%tpc");
#else
mdb_printf("%-16s %-4s %-12s %-4s %s\n",
"%tick", "%tt", "", "%tl", "%tpc");
#endif
}
mdb_warn("couldn't walk ttrace");
return (DCMD_ERR);
}
return (DCMD_OK);
}
#ifdef sun4v
/*ARGSUSED*/
int
{
int i, htraptrace_buf_inuse = 0;
if (argc != 0)
return (DCMD_USAGE);
if (fetch_ncpu())
return (DCMD_ERR);
"trap_trace_ctl") == -1) {
mdb_warn("symbol 'trap_trace_ctl' not found");
return (DCMD_ERR);
}
if (ctl->d.hvaddr_base == 0)
continue;
htraptrace_buf_inuse = 1;
mdb_printf("htrap_trace_ctl[%d] = {\n", i);
}
if (!htraptrace_buf_inuse) {
mdb_warn("hv traptrace not configured");
return (DCMD_ERR);
}
return (DCMD_OK);
}
/*ARGSUSED*/
static int
{
const char *ttstr;
if (*cpu == -1)
else
return (0);
/*
* Convert the tt value to a string using our gaint lookuo table
*/
mdb_printf("%016llx %02x %04hx %04hx %-16s %02x %02x %0?p %A\n",
return (WALK_NEXT);
}
/*ARGSUSED*/
static int
{
if (*cpu == -1)
return (WALK_NEXT);
mdb_printf("%016llx %016llx %02x %02x %04hx %04hx %02x %02x %0?p "
"[%p,%p,%p,%p]\n",
return (WALK_NEXT);
}
typedef struct httrace_cpu_data {
typedef struct httrace_walk_data {
int tw_ncpu;
int
{
int i, htraptrace_buf_inuse = 0;
mdb_warn("httrace only supports global walks\n");
return (WALK_ERR);
}
if (fetch_ncpu())
return (WALK_ERR);
"trap_trace_ctl") == -1) {
mdb_warn("symbol 'trap_trace_ctl' not found");
return (WALK_ERR);
}
for (i = 0; i < ncpu; i++) {
if (ctl->d.hvaddr_base == 0)
continue;
htraptrace_buf_inuse = 1;
mdb_warn("failed to read hv trap trace buffer at %p",
ctl->d.hvaddr_base);
} else {
}
}
if (!htraptrace_buf_inuse) {
mdb_warn("hv traptrace not configured");
return (DCMD_ERR);
}
return (WALK_NEXT);
}
int
{
continue;
done = 0;
mdb_warn("Warning: tt_tick == 0\n");
oldest = i;
}
}
if (done)
return (-1);
if (oldest_tick != 0)
wsp->walk_cbdata);
/* first record of the trap trace buffer is trap trace header */
sizeof (struct htrap_trace_record));
}
return (status);
}
void
{
}
int
{
return (DCMD_USAGE);
if (flags & DCMD_ADDRSPEC) {
if (fetch_ncpu())
return (DCMD_ERR);
return (DCMD_ERR);
}
}
if (cpu == -1)
mdb_printf("CPU ");
if (opt_x) {
mdb_printf("%-16s %-16s %-3s %-3s %-4s %-4s %-3s %-3s %-?s "
"F1-4\n", "%tick", "%tstate", "%hp", "%ty", "%tag",
"%tt", "%tl", "%gl", "%tpc");
} else {
mdb_printf("%-16s %-3s %-4s %-4s %-16s %-3s %-3s %s\n",
"%tick", "%ty", "%tag", "%tt", "", "%tl", "%gl",
"%tpc");
}
mdb_warn("couldn't walk httrace");
return (DCMD_ERR);
}
return (DCMD_OK);
}
#endif
struct {
int xc_type;
const char *xc_str;
} xc_data[] = {
{ XT_ONE_SELF, "xt-one-self" },
{ XT_ONE_OTHER, "xt-one-other" },
{ XT_SOME_SELF, "xt-some-self" },
{ XT_SOME_OTHER, "xt-some-other" },
{ XT_ALL_SELF, "xt-all-self" },
{ XT_ALL_OTHER, "xt-all-other" },
{ XC_ONE_SELF, "xc-one-self" },
{ XC_ONE_OTHER, "xc-one-other" },
{ XC_ONE_OTHER_H, "xc-one-other-h" },
{ XC_SOME_SELF, "xc-some-self" },
{ XC_SOME_OTHER, "xc-some-other" },
{ XC_SOME_OTHER_H, "xc-some-other-h" },
{ XC_ALL_SELF, "xc-all-self" },
{ XC_ALL_OTHER, "xc-all-other" },
{ XC_ALL_OTHER_H, "xc-all-other-h" },
{ XC_ATTENTION, "xc-attention" },
{ XC_DISMISSED, "xc-dismissed" },
{ XC_LOOP_ENTER, "xc-loop-enter" },
{ XC_LOOP_DOIT, "xc-loop-doit" },
{ XC_LOOP_EXIT, "xc-loop-exit" },
{ 0, NULL }
};
/*ARGSUSED*/
int
{
break;
}
}
str = "xcall-cont";
mdb_printf("%3d %016llx %-16s %08x %08x %08x %08x\n",
return (WALK_NEXT);
str = "int-vec";
} else {
return (WALK_NEXT);
}
return (WALK_NEXT);
}
/*ARGSUSED*/
int
{
return (DCMD_USAGE);
mdb_warn("couldn't walk ttrace");
return (DCMD_ERR);
}
return (DCMD_OK);
}
/*
* Grrr... xc_mbox isn't in an _impl header file; we define it here.
*/
typedef struct xc_mbox {
} xc_mbox_t;
typedef struct xc_mbox_walk {
int xw_ndx;
static int
{
mdb_warn("couldn't find 'xc_mbox'");
return (WALK_ERR);
}
if (fetch_ncpu() || fetch_mbox())
return (WALK_ERR);
mdb_warn("couldn't read 'xc_mbox'");
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
int status;
return (WALK_DONE);
return (status);
}
static void
{
}
static int
{
const char *state;
if (argc != 0)
return (DCMD_USAGE);
if (!(flags & DCMD_ADDRSPEC)) {
mdb_warn("can't walk 'xc_mbox'");
return (DCMD_ERR);
}
return (DCMD_OK);
}
if (fetch_ncpu() || fetch_mbox())
return (DCMD_ERR);
if (DCMD_HDRSPEC(flags)) {
mdb_printf("%3s %-8s %-8s %-9s %-16s %-16s %s\n",
"CPU", "ADDR", "STATE", "CPUSET", "ARG1", "ARG2", "HNDLR");
}
return (DCMD_ERR);
}
return (DCMD_OK);
mdb_warn("couldn't read 'xc_mbox'");
return (DCMD_ERR);
}
/* LINTED - alignment */
*(int *)((char *)mbox + mbox_stoff));
mdb_printf("%3d %08x %-8s [ ",
mdb_printf(" ] %-16a %-16a %a\n",
return (DCMD_OK);
}
typedef struct vecint_walk_data {
int
{
mdb_warn("vecint walk only supports global walks\n");
return (WALK_ERR);
}
mdb_warn("couldn't read intr_vec_table");
return (WALK_ERR);
}
return (WALK_NEXT);
}
int
{
int status;
continue;
}
return (WALK_DONE);
wsp->walk_cbdata);
return (WALK_ERR);
}
return (status);
}
void
{
}
int
{
if (!(flags & DCMD_ADDRSPEC)) {
mdb_warn("can't walk vecint");
return (DCMD_ERR);
}
return (DCMD_OK);
}
if (DCMD_HDRSPEC(flags)) {
"PIL", "ARG1", "ARG2", "HANDLER");
}
return (DCMD_ERR);
}
return (DCMD_OK);
}
int
{
mdb_warn("softint walk only supports global walks\n");
return (WALK_ERR);
}
/* Read global softint linked list pointer */
mdb_warn("failed to read the global softint_list pointer\n");
return (WALK_ERR);
}
return (WALK_NEXT);
}
/*ARGSUSED*/
void
{
/* Nothing to do here */
}
int
{
int status;
return (WALK_DONE);
wsp->walk_cbdata);
return (WALK_ERR);
}
return (status);
}
int
{
if (!(flags & DCMD_ADDRSPEC)) {
mdb_warn("can't walk softint");
return (DCMD_ERR);
}
return (DCMD_OK);
}
if (DCMD_HDRSPEC(flags)) {
"PEND", "PIL", "ARG1", "ARG2", "HANDLER");
}
return (DCMD_ERR);
}
return (DCMD_OK);
}
static int
mdb_whatis_t *w)
{
&cur))
return (WHATIS_WALKRET(w));
}
/*ARGSUSED*/
static int
{
return (0);
mdb_warn("failed to walk 'ttrace'");
return (0);
}
/*ARGSUSED*/
int
{
return (WALK_NEXT);
}
int
{
return (WALK_ERR);
if (!MUTEX_TYPE_ADAPTIVE(&mtx))
return (WALK_DONE);
return (WALK_DONE);
return (WALK_DONE);
}
#ifdef sun4v
#endif
vecint_dcmd },
softint_dcmd },
{ "sfmmu_vtop", ":[[-v] -a as]", "print virtual to physical mapping",
sfmmu_vtop },
tsbinfo_help },
{ NULL }
};
{ "mutex_owner", "walks the owner of a mutex",
{ "ttrace", "walks the trap trace buffer for a CPU",
#ifdef sun4v
{ "httrace", "walks the hv trap trace buffer for a CPU",
#endif
{ "xc_mbox", "walks the cross call mail boxes",
{ "vecint", "walk the list of registered hardware interrupts",
{ "softint", "walk the list of registered software interrupts",
{ "memseg", "walk the memseg structures",
{ NULL }
};
const mdb_modinfo_t *
_mdb_init(void)
{
mdb_warn("couldn't find intr_vec_table");
return (NULL);
}
return (&modinfo);
}