/*
* 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 <fpc.h>
#include <fpc-impl.h>
static int this_node = 0;
int fpc_debug = 0;
};
JBC_PIC0_EVT_MASK, /* JBC counter 0 */
JBC_PIC1_EVT_MASK, /* JBC counter 1 */
IMU_PIC0_EVT_MASK, /* IMU counter 0 */
IMU_PIC1_EVT_MASK, /* IMU counter 1 */
MMU_PIC0_EVT_MASK, /* MMU counter 0 */
MMU_PIC1_EVT_MASK, /* MMU counter 1 */
TLU_PIC0_EVT_MASK, /* TLU counter 0 */
TLU_PIC1_EVT_MASK, /* TLU counter 1 */
TLU_PIC2_EVT_MASK, /* TLU counter 2 */
LPU_PIC0_EVT_MASK, /* LPU counter 1 */
LPU_PIC1_EVT_MASK /* LPU counter 2 */
};
/* Offsets of the fields shown in event_field_masks. */
PIC0_EVT_SEL_SHIFT, /* JBC counter 0 */
PIC1_EVT_SEL_SHIFT, /* JBC counter 1 */
PIC0_EVT_SEL_SHIFT, /* IMU counter 0 */
PIC1_EVT_SEL_SHIFT, /* IMU counter 1 */
PIC0_EVT_SEL_SHIFT, /* MMU counter 0 */
PIC1_EVT_SEL_SHIFT, /* MMU counter 1 */
PIC0_EVT_SEL_SHIFT, /* TLU counter 0 */
PIC1_EVT_SEL_SHIFT, /* TLU counter 1 */
PIC2_EVT_SEL_SHIFT, /* TLU counter 2 */
PIC0_EVT_SEL_SHIFT, /* LPU counter 1 */
PIC2_EVT_SEL_SHIFT /* LPU counter 2 */
};
/* For determining platform suitability at _init time. */
int
{
return (fpc_platform_check());
}
/*ARGSUSED*/
void
{
}
int
{
int i;
*avail = 0;
for (i = 1; i < MAX_REG_TYPES; i++) {
first_reg_of_type[i] =
}
/*
* Look thru first level of device tree only.
* Assume there can be no more than NUM_LEAVES nodes in the system.
*/
dip = ddi_root_node();
return (DDI_FAILURE);
}
}
int
{
int i;
for (i = 0; i < NUM_LEAVES; i++) {
}
}
return (DDI_SUCCESS);
}
char
{
}
void *
{
}
int
{
return (SUCCESS);
}
static int
{
return (SUCCESS);
}
static int
{
"fpc_get_counter_reg_index: regtype:%d, counter:%d, bounds:%d\n",
return (-1);
}
/*
* Program a performance counter.
*
* reggroup is which type of counter.
* counter is the counter number.
* event is the event to program for that counter.
*/
int
{
int counter_index;
FPC_DBG1("fpc_perfcnt_program enter:\n");
return (EIO);
(void) fpc_free_counter_handle(firehdl);
return (EIO);
}
SUCCESS) {
goto done_pgm;
}
continue;
goto done_pgm;
}
if (old_events != new_events) {
if ((rval =
SUCCESS) {
FPC_DBG1("Write of new event data failed, group:%d\n",
reggroup);
goto done_pgm;
}
}
(void) fpc_free_counter_handle(firehdl);
return (rval);
}
/*
* Read a performance counter.
*
* reggroup is which type of counter.
* event_p returns the event programmed for that counter.
* values returns the counter values.
*/
int
{
int counter_index;
int rval;
return (EIO);
return (EIO);
goto done_read;
goto done_read;
FPC_DBG1("Read_counter %d / %d, status:%d, value returned:0x%"
}
(void) fpc_free_counter_handle(firehdl);
return (rval);
}