/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#include <ctype.h>
#include <sys/mdb_modapi.h>
#include <sys/mach_descrip.h>
#include <sys/mdesc_impl.h>
/*ARGSUSED*/
int
{
if (flags & DCMD_ADDRSPEC)
return (DCMD_USAGE);
return (DCMD_USAGE);
mdb_warn("failed to read 'curr_mach_descrip'");
return (DCMD_ERR);
}
if (verbose)
mdb_printf("ADDRESS VA MEMOPS SIZE\n");
do {
return (DCMD_ERR);
}
if (verbose)
mdb_printf("%-11lx %-11lx %-11lx %-11lx\n",
else
return (DCMD_OK);
}
/*ARGSUSED*/
int
{
char *namep;
if (flags & DCMD_ADDRSPEC) {
if ((addr & 7) != 0) {
return (DCMD_ERR);
}
} else {
mdb_warn("failed to read 'curr_mach_descrip'");
return (DCMD_ERR);
}
return (DCMD_ERR);
}
}
return (DCMD_ERR);
}
/* find space for each section of the MD */
mdb_warn("failed to allocate memory for mde block");
return (DCMD_ERR);
}
mdb_warn("failed to allocate memory for name block");
return (DCMD_ERR);
}
mdb_warn("failed to allocate memory for data block");
return (DCMD_ERR);
}
/* store each of the MD sections */
+ MD_HEADER_SIZE);
return (DCMD_ERR);
}
!= namesize) {
+ mdesize);
return (DCMD_ERR);
}
return (DCMD_ERR);
}
mdb_printf("TYPE OFFSET NAME PROPERTY\n");
case MDET_NODE:
mdb_printf("node %-6x %-22s idx=%-11lx\n",
break;
case MDET_PROP_ARC:
mdb_printf("arc %-6x %-22s idx=%-11lx\n",
break;
case MDET_PROP_DAT:
mdb_printf("data %-6x %-22s len=%x, offset=%x\n",
break;
case MDET_PROP_STR:
mdb_printf("str %-6x %-22s len=%x, offset=%x\n",
break;
case MDET_PROP_VAL:
mdb_printf("val %-6x %-22s val=%-11lx\n",
break;
case MDET_NODE_END:
mdb_printf("end\n");
break;
case MDET_NULL:
mdb_printf("null\n");
break;
case MDET_LIST_END:
mdb_printf("end of list\n");
break;
default:
break;
}
}
return (DCMD_OK);
}
/*ARGSUSED*/
int
{
return (DCMD_ERR);
}
return (DCMD_OK);
}
/*ARGSUSED*/
int
{
if (flags & DCMD_ADDRSPEC) {
if ((addr & 7) != 0) {
return (DCMD_ERR);
}
} else {
mdb_warn("failed to read 'curr_mach_descrip'");
return (DCMD_ERR);
}
return (DCMD_ERR);
}
}
return (DCMD_ERR);
}
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
}
/*
* MDB module linkage information:
*
* Declare a list of structures describing dcmds, and a function
* named _mdb_init to return a pointer to module information.
*/
{ "mdescinfo", "?", "print md_elements with names from sun4v MD",
mdinfo },
{ "mdescdump", "?", "dump node, name, data sections of sun4v MD",
mddump },
{ NULL }
};
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}