/*
* 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.
*/
#include <mdb/mdb_modapi.h>
#include "bitset.h" /* XXX work out ifdef in include file... */
void
bitset_help(void)
{
mdb_printf("Print the bitset at the address given\n");
}
static void
{
return;
}
static bitset_t *
{
return (NULL);
}
return (NULL);
}
return (bs);
}
static int
{
int high;
int i;
return (-1);
/* move backwards through words */
break;
if (i < 0)
return (-1);
/* move backwards through bits */
high = i << BT_ULSHIFT;
for (i = BT_NBIPUL - 1; i; i--)
break;
return (high + i + 1);
}
static int
{
int res;
res *= 10;
return (res);
}
static int
{
int res = 0;
do {
res++;
val /= 10;
} while (val);
return (res);
}
/*
* The following prints a bitset with a 'ruler' that look like this
*
* 11111111112222222222333333333344444444445555555555666666666677
* 012345678901234567890123456789012345678901234567890123456789012345678901
* xx:........................................................................
* 11111111111111111111111111111111111111111111
* 777777778888888888999999999900000000001111111111222222222233333333334444
* 234567890123456789012345678901234567890123456789012345678901234567890123
* ........................................................................
* 111111111111111111111111111111111111111111111111111111112222222222222222
* 444444555555555566666666667777777777888888888899999999990000000000111111
* 456789012345678901234567890123456789012345678901234567890123456789012345
* ........................................................................
* 2222222222
* 1111222222
* 6789012345
* ..........
*
* to identify individual bits that are set.
*/
static void
{
int val_start;
int val_max;
int label_width;
int ruler_width;
int nl, l;
int i;
int p;
char c;
val_start = 0;
return;
}
if ((v + ruler_width) < val_max)
vm = v + ruler_width;
else
for (l = nl; l >= 0; l--) {
p = pow10(l);
for (i = 0; i < label_width; i++)
mdb_printf(" ");
if ((l == nl) && (c == '0'))
c = ' ';
mdb_printf("%c", c);
}
mdb_printf("\n");
}
if (v == val_start) {
} else {
for (i = 0; i < label_width; i++)
mdb_printf(" ");
}
mdb_printf("X");
else
mdb_printf(".");
}
mdb_printf("\n");
}
}
/*ARGSUSED*/
int
{
return (DCMD_ERR);
return (DCMD_OK);
}