/*
* 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 FPC_REQ_MINOR_VER 0
NULL,
};
static int hyp_regd_users = 0;
/*
* The following typedef is used to represent a
* 1275 "reg" property of a PCI nexus.
*/
typedef struct nexus_regspec {
};
/*
* 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.
*/
};
/* Called by _init to determine if it is OK to install driver. */
int
{
int regstat;
(void) hsvc_unregister(&fpc_hsvc);
}
fpc_sup_minor = 0;
return (regstat);
}
/* Called during attach to do module-wide initialization. */
/*ARGSUSED*/
int
{
return (DDI_SUCCESS);
}
int
{
int regstat;
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.
*/
/*
* If this is the first time through here, negotiate with hypervisor
* that it has the services needed to operate. Don't do this in _init
* since we may want to modload the driver without attaching,
* for debugging purposes.
*
* Note that this is another way of weeding out unsupported platforms
*/
if (hyp_regd_users == 0) {
/*
* Fail silently since we don't want to print an error
* on future platforms which don't support this driver.
*/
return (DDI_FAILURE);
}
}
/* 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
{
if (--hyp_regd_users == 0)
(void) hsvc_unregister(&fpc_hsvc);
}
/*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
{
}