/*
* 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
*/
/*
*/
/*
* Kstat support for X86 PCI driver
*/
#include <sys/mach_intr.h>
typedef struct pci_kstat_private {
static struct {
} pci_ks_template = {
{ "name", KSTAT_DATA_CHAR },
{ "type", KSTAT_DATA_CHAR },
{ "cpu", KSTAT_DATA_UINT64 },
{ "pil", KSTAT_DATA_UINT64 },
{ "time", KSTAT_DATA_UINT64 },
{ "ino", KSTAT_DATA_UINT64 },
{ "cookie", KSTAT_DATA_UINT64 },
{ "devpath", KSTAT_DATA_STRING },
{ "buspath", KSTAT_DATA_STRING },
};
psm_intr_op_t, int *);
/*ARGSUSED*/
static int
{
/*
* Note that although possibly multiple vectors can map to an IRQ, the
* vector returned below will always be the same for a given IRQ
* specified, and so all kstats for a given IRQ will report the same
* value for the ino field.
*
* ---
*
* Check for the enabled state, since kstats are set up when the ISR is
* added, not enabled. There may be a period where interrupts are not
* enabled even though they may have been added.
*
* It is also possible that the vector is for a dummy interrupt.
* pci_get_intr_from_vecirq will return failure in this case.
*/
DDI_SUCCESS) ||
/* Interrupt is user-bound. Remove kstat. */
(void) taskq_dispatch(system_taskq,
return (0);
}
/*
* Interrupt is valid (not a dummy), not user-bound to a specific cpu,
* and enabled. Update kstat fields.
*/
case DDI_INTR_TYPE_MSI:
break;
case DDI_INTR_TYPE_MSIX:
break;
default:
break;
}
/* CPU won't be user bound at this point. */
return (0);
}
{
sizeof (pci_ks_template) / sizeof (kstat_named_t),
}
}
/*
* This function is invoked in two ways:
* - Thru taskq thread via pci_ih_ks_update to remove kstats for user-bound
* interrupts.
* - From the REMISR introp when an interrupt is being removed.
*/
void
{
if (ksp) {
/*
* Delete the kstat before removing the private pointer, to
* prevent a kstat update from coming after private is freed.
*/
}
}