/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/machsystm.h>
#include <sys/cheetahregs.h>
/*
* Note: We assume that chipid == portid. This is not necessarily true.
* We buried it down here in the implementation, and not in the
* interfaces, so that we can change it later.
*/
/*
* pre-alloc'ed because this is used early in boot (before the memory
* allocator is available).
*/
/*
* Returns 1 if cpuid is CMP-capable, 0 otherwise.
*/
int
{
/* N.B. We're assuming that the cpunode[].portid is still intact */
}
/*
* Indicate that this core (cpuid) resides on the chip indicated by chipid.
* Called during boot and DR add.
*/
void
{
}
/*
* Indicate that this core (cpuid) is being DR removed.
*/
void
{
/* N.B. We're assuming that the cpunode[].portid is still intact */
}
/*
* Called when cpuid is being onlined or offlined. If the offlined
* processor is CMP-capable then current target of the CMP Error Steering
* Register is set to either the lowest numbered on-line sibling core, if
* one exists, or else to this core.
*/
/* ARGSUSED */
void
{
#ifndef _CMP_NO_ERROR_STEERING
int i;
if (!cmp_cpu_is_cmp(cpuid))
return;
/* Look for an online sibling core */
for (i = 0; i < NCPU; i++) {
if (i == cpuid)
continue;
if (CPU_IN_SET(mycores, i) &&
/* Found one, reset error steering */
break;
}
}
/* No online sibling cores, point to this core. */
if (i == NCPU) {
}
#else
/* Not all CMP's support (e.g. Olympus-C by Fujitsu) error steering */
return;
#endif /* _CMP_NO_ERROR_STEERING */
}
{
if (!cmp_cpu_is_cmp(cpuid)) {
/* This CPU is not a CMP, so by definition chipid==cpuid */
return (cpuid);
}
/* N.B. We're assuming that the cpunode[].portid is still intact */
}
/* ARGSUSED */
int
{
int impl;
switch (hw) {
case PGHW_IPIPE:
return (1);
break;
case PGHW_CHIP:
return (1);
break;
case PGHW_CACHE:
return (1);
break;
}
return (0);
}
int
{
int impl;
switch (hw) {
case PGHW_IPIPE:
case PGHW_CHIP:
case PGHW_CACHE:
return (1);
} else {
return (0);
}
}
return (0);
}
{
int impl;
switch (hw) {
case PGHW_IPIPE:
/*
* Currently only Fujitsu Olympus-C (SPARC64-VI) and
* Jupiter (SPARC64-VII) processors support
* multi-stranded cores. Return the cpu_id with the
* strand bit masked out.
*/
} else {
}
case PGHW_CHIP:
case PGHW_CACHE:
if (IS_PANTHER(impl) ||
else
default:
return (-1);
}
}
/*
* Rank the relative importance of optimizing for hw1 or hw2
*/
{
int i;
int rank1 = 0;
int rank2 = 0;
};
for (i = 0; hw_hier[i] != PGHW_NUM_COMPONENTS; i++) {
rank1 = i;
rank2 = i;
}
return (hw1);
else
return (hw2);
}
/*
* Override the default CMT dispatcher policy for the specified
* hardware sharing relationship
*/
/* ARGSUSED */
{
/* Accept the default polices */
return (CMT_NO_POLICY);
}
{
}
void
cmp_set_nosteal_interval(void)
{
/* Set the nosteal interval (used by disp_getbest()) to 100us */
nosteal_nsec = 100000UL;
}
/*
* Return 1 if CMT load balancing policies should be
* implemented across instances of the specified hardware
* sharing relationship.
*/
int
{
if (hw == PGHW_IPIPE ||
return (1);
else
return (0);
}
/*
* Return 1 if thread affinity polices should be implemented
* for instances of the specifed hardware sharing relationship.
*/
int
{
if (hw == PGHW_CACHE)
return (1);
else
return (0);
}
/*
* Return number of counter events requested to measure hardware capacity and
* utilization and setup CPC requests for specified CPU if list where to add
* CPC requests is given
*/
int
/* LINTED E_FUNC_ARG_UNUSED */
{
/*
* Return error to tell common code to decide what counter events to
* program on this CPU for measuring hardware capacity and utilization
*/
return (-1);
}