intr.c revision 36fe4a92b52649b0979d6a13212f4cea730d19c7
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 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/ddi_subrdefs.h>
#include "px_obj.h"
static int intr_pci_walk_step(mdb_walk_state_t *);
static int intr_px_walk_step(mdb_walk_state_t *);
static void intr_pci_print_items(mdb_walk_state_t *);
static void intr_px_print_items(mdb_walk_state_t *);
static char *intr_get_intr_type(msiq_rec_type_t);
static void intr_print_line(int);
static void intr_print_banner(void);
typedef struct intr_info {
int instance;
int shared;
char driver_name[12];
char pathname[MAXNAMELEN];
}
static void intr_print_elements(intr_info_t);
static int detailed = 0; /* Print detailed view */
static int
{
return (WALK_NEXT);
}
static int
{
/* read globally declared structures in the pci driver */
}
/* read globally declared structures in the px driver */
}
return (WALK_DONE);
}
static int
{
/* Read start of state structure array */
mdb_warn("intr: failed to read the initial pci_per_p "
"structure\n");
return (WALK_ERR);
}
/* Figure out how many items are here */
/* Read until nothing is left */
return (WALK_DONE);
}
start_addr += sizeof (uintptr_t);
}
return (WALK_DONE);
}
static int
{
/* Read start of state structure array */
mdb_warn("intr: failed to read the initial px_per_p "
"structure\n");
return (WALK_ERR);
}
/* Figure out how many items are here */
/* Read until nothing is left */
return (WALK_DONE);
}
start_addr += sizeof (uintptr_t);
}
return (WALK_DONE);
}
static void
{
int count;
mdb_warn("intr: failed to read pci interrupt block "
"structure\n");
return;
}
/* Read in ib_ino_info_t structure at address */
/* Nothing here to read from */
return;
}
intr_print_line(77);
intr_print_line(77);
do {
mdb_warn("intr: failed to read pci interrupt entry "
"structure\n");
return;
}
count = 0;
do {
}
/* Get instance */
mdb_warn("intr: failed to read DIP "
"structure\n");
return;
}
/* Make sure the name doesn't over run */
count++;
intr_print_line(77);
}
static void
{
int count;
mdb_warn("intr: failed to read px interrupt block "
"structure\n");
return;
}
/* Read in px_ib_ino_info_t structure at address */
/* Nothing here to read from */
return;
}
intr_print_line(77);
intr_print_line(77);
do {
mdb_warn("intr: failed to read px interrupt entry "
"structure\n");
return;
}
count = 0;
do {
}
/* Get instance */
mdb_warn("intr: failed to read DIP "
"structure\n");
return;
}
/* Make sure the name doesn't over run */
count++;
intr_print_line(77);
}
static char *
{
switch (rec_type) {
case MSG_REC:
return ("PCIe");
case MSI32_REC:
case MSI64_REC:
return ("MSI");
case INTX_REC:
default:
return ("Fixed");
}
}
static void
intr_print_line(int cnt)
{
int x;
if (!detailed) {
mdb_printf("+");
for (x = 0; x < cnt; x++) {
mdb_printf("-");
}
mdb_printf("+\n");
}
}
static void
intr_print_banner(void)
{
if (!detailed) {
mdb_printf("| Device\t"
"| Shard\t"
"| Type\t"
"| MSG #\t"
"| State "
"| INO\t"
"| Mondo\t"
"| Pil\t"
"| CPU "
"|\n");
}
}
static void
{
if (!detailed) {
mdb_printf("| %s\t",
mdb_printf("| --- \t");
} else {
}
mdb_printf("| %2s\t",
mdb_printf("\t");
}
} else {
mdb_printf("\n-------------------------------------------\n");
mdb_printf("Interrupt Type:\t%s\n",
mdb_printf("Shared Intr:\t%s\n",
}
}
/*ARGSUSED*/
static void
{
/* Nothing to do here */
}
/*ARGSUSED*/
static int
{
detailed = 0;
return (DCMD_USAGE);
if (!(flags & DCMD_ADDRSPEC)) {
== -1) {
return (DCMD_ERR);
}
return (DCMD_OK);
}
return (DCMD_OK);
}
/*
* MDB module linkage information:
*/
static const mdb_dcmd_t dcmds[] = {
{ "interrupts", "[-d]", "display the interrupt info registered with "
{ NULL }
};
static const mdb_walker_t walkers[] = {
{ NULL }
};
static const mdb_modinfo_t modinfo = {
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}