uppc.c revision abf601c9b581ed63a268ad83f92233cd0885090a
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stddef.h>
#include <sys/mdb_modapi.h>
#include <sys/psm_common.h>
/*
* Option usage
*/
int option_flags;
void
interrupt_help(void)
{
mdb_printf("Prints the interrupt usage on the system.\n"
"By default, only interrupt service routine names are printed.\n\n"
"Switches:\n"
" -d instead of ISR, print <driver_name><instance#>\n"
" -i show like intrstat, cpu# ISR/<driver_name><instance#>\n");
}
static char *
{
mdb_warn("failed to read child dip");
return ("-");
}
while (dev_info.devi_parent != 0) {
break;
return ("ISA");
return ("PCI");
}
return ("-");
}
static void
{
if (option_flags & INTR_DISPLAY_DRVR_INST) {
sizeof (driver_name)) == 0) {
dip_addr);
} else
} else
}
/*
* uppc_interrupt_dump:
* Dump uppc(7d) interrupt information.
*/
/* ARGSUSED */
int
{
int i, share_cnt;
option_flags = 0;
return (DCMD_USAGE);
mdb_warn("failed to read autovect");
return (DCMD_ERR);
}
mdb_warn("failed to read uppc_irq_shared_table");
return (DCMD_ERR);
}
/*
* All x86 systems load uppc(7d) by default.
* Now, this becomes interesting on APIC based systems.
* 'interrupts' dcmd is supported by both the .so modules
* So, uppc(7d) needs to be unloaded somehow on APIC based systems
* Here a check for shared_tbl[i] and returning NULL takes care of that
*/
for (i = 0; i < MAX_ISA_IRQ + 1; i++)
if (shared_tbl[i]) {
break;
}
NULL) == 0) {
return (mdb_call_dcmd("pcplusmp`interrupts",
}
}
/* Print the header first */
mdb_printf("%<u>CPU\t ");
else
mdb_printf("%<u>IRQ Vector IPL(lo/hi) Bus Share ");
"Driver Name(s)" : "ISR(s)");
/* Walk all the entries */
for (i = 0; i < MAX_ISA_IRQ + 1; i++) {
/* Read the entry, if invalid continue */
continue;
/* Print each interrupt entry */
share_cnt = shared_tbl[i];
mdb_printf("cpu0\t");
else
mdb_printf("%3d 0x%2x %4d/%-2d %-4s %3d ",
if (share_cnt)
while (share_cnt-- > 0) {
mdb_printf(", ");
}
}
mdb_printf("\n");
}
return (DCMD_OK);
}
/*
* MDB module linkage information:
*/
static const mdb_dcmd_t dcmds[] = {
{ NULL }
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}