fpc-impl-4v.c revision 110e73f9b5ccaa10e26a8f79807001a5da72604e
/*
* 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 <sys/hypervisor_api.h>
#include <fpc.h>
#include <fpc-impl.h>
#include <fpc-impl-4v.h>
#define PCIE_ROOTNEX_COMPATIBLE_NAME "SUNW,sun4v-pci"
/*
* The following typedef is used to represent a
* 1275 "reg" property of a PCI nexus.
*/
typedef struct nexus_regspec {
static uint64_t counter_select_index[] = {
};
/*
* The following event and offset arrays is organized by grouping in major
* order the fire_perfcnt_t register types, and in minor order the register
* numbers within that type.
*/
/*
* This table maps the above order into the hypervisor interface register
* indices.
*/
static uint64_t counter_reg_index[] = {
};
/*ARGSUSED*/
int
{
return (DDI_SUCCESS);
}
int
{
int index;
return (DDI_SUCCESS);
if (!is_root_pcie_nexus)
return (DDI_SUCCESS);
return (DDI_FAILURE);
/*
* Initilize device handle. The device handle uniquely
* identifies a SUN4V device. It consists of the lower 28-bits
* of the hi-cell of the first entry of the SUN4V device's
* "reg" property as defined by the SUN4V Bus Binding to Open
* Firmware.
*/
/* See which register sets are usable from this node. */
SUCCESS);
SUCCESS);
/* Nothing usable at this node. */
if ((!jbus_regs_avail) && (!pcie_regs_avail))
return (DDI_SUCCESS);
if (pcie_regs_avail)
*avail |=
if (jbus_regs_avail) {
*avail |= JBUS_REGS_AVAIL;
if (index != 0)
"fpc: JBUS regs available on device idx %d!\n",
index);
}
return (DDI_SUCCESS);
}
/*ARGSUSED*/
void
fpc_platform_node_fini(void *arg)
{
}
/*ARGSUSED*/
void
{
}
{
void *platform_specific_data;
if ((platform_specific_data =
return ((fire_perfreg_handle_t)-1);
else
return ((fire_perfreg_handle_t)platform_specific_data);
}
/*ARGSUSED*/
int
{
return (SUCCESS);
}
static int
{
int rval;
if (is_write)
else
}
int
{
}
/*ARGSUSED*/
int
{
}