/*
* 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
*/
/*
*/
/*
* Enumerate a CPU node
*/
#include <strings.h>
#include <fm/topo_mod.h>
#include "pi_impl.h"
typedef struct cpuwalk_s {
char *serial;
} cpuwalk_t;
int
{
int result;
int err;
int cpumask;
/*
* Create the basic topology node for the CPU using the generic
* enumerator.
*/
if (result != 0) {
/* Error messages are printed by the generic routine */
return (result);
}
/*
* If the hc_name is "chip" or "core", a topo method is set to compute
* asru, otherwise for "cpu" and "strand", set asru to CPU scheme FMRI.
*/
if (result != 0) {
"%s node_0x%llx failed to get resource: %s\n",
return (-1);
}
&err);
if (result != 0) {
"%s node_0x%llx failed to set ASRU: %s\n",
return (-1);
}
} else {
/*
* Compute ASRU for "cpu" and "strand" node.
* Get the parameters required to create an FMRI. The cpumask
* is on the chip itself and while it may be part of an ereport
* payload is unavailable here, so we set it to zero.
*/
cpumask = 0;
/*
* Find the serial number, which is on the "chip" node, not the
* "cpu" node.
*/
"%s node_0x%llx failed to find serial number.\n",
return (result);
}
/*
* Create a CPU scheme FMRI and set it as the ASRU for the CPU
* node
*/
"compute cpu scheme ASRU: %s\n",
return (-1);
}
/* Set the ASRU on the node without flags (the 0) */
}
if (result != 0) {
"%s node_0x%llx failed to set ASRU: %s\n", _ENUM_NAME,
return (-1);
}
return (0);
}
static int
char **serial)
{
int result;
/*
* Search backwards through the PRI graph, starting at the current
* strand (aka cpu) mde_node, and find the MD_STR_CHIP node. This
* node has the serial number for the cpu.
*/
pi_enum_cpu_serial_cb, (void *)&args);
return (result);
}
/*ARGSUSED*/
static int
{
char *hc_name;
return (MDE_WALK_ERROR);
}
}
}