/*
* 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 <string.h>
#include <umem.h>
#include <cpu_mdesc.h>
static void *
{
}
static void
{
}
int i;
/* search the processor based on the physical id */
return (procp);
}
}
return (NULL);
}
int i;
return (mcmp);
}
}
return (NULL);
}
int
{
return (0);
}
return (-1);
}
static int
{
uint64_t x;
listp);
mcmp->cpumap_pid = x;
mcmp->cpumap_serialno = 0;
&mcmp->cpumap_serialno) < 0) {
continue;
}
if (mcmp->cpumap_serialno == 0) {
continue;
}
/*
* physical proc id.
* Find if there is already an existing processor entry
* Assign procid based on the order found during reading
*/
break;
}
}
mcmp->cpumap_chipidx = i;
"chip[%d] serial is %llx\n",
}
}
}
return (0);
}
static int
{
int i, j, cnt;
int procid_flag = 0;
/* Count the number of processors and strands */
list1p);
if (ncomp <= 0) {
return (-1);
}
nproc++;
/* check if the physical id exists */
== 0) {
procid_flag = 1;
}
}
ncpu++;
}
}
return (-1);
}
/* Alloc processors and strand entries */
/* Visit each processor node */
continue;
&strserial) < 0) {
"Failed to get the serial number of"
"proc[%d]\n", nproc);
continue;
} else {
"Failed to convert the serial "
"string to serial int of "
"proc[%d]\n", nproc);
continue;
}
}
}
/* Assign physical proc id */
if (procid_flag) {
== 0) {
}
} else {
}
/* Get all the strands below this proc */
list1p[i],
list2p);
if (cnt <= 0) {
nproc++;
procp++;
continue;
}
for (j = 0; j < cnt; j++) {
/* Consider only the strand nodes */
continue;
mcmp->cpumap_pid = x;
ncpu++;
mcmp++;
}
/*
* To get the fru of this proc, follow the back arc up to
* find the first node whose fru field is set
*/
list1p[i],
list2p);
if (cnt <= 0) {
nproc++;
procp++;
continue;
}
for (j = 0; j < cnt; j++) {
/* test the fru field which must be positive number */
== 0) && x > 0)
break;
}
if (j < cnt) {
/* Found the FRU node, get the fru identity */
else
&str))
} else {
}
nproc++;
procp++;
} /* for i */
return (0);
}
/*
* Extract from the PRI the processor, strand and their fru identity
*/
int
{
}
if ((type & LDOM_TYPE_CONTROL) != 0) {
} else {
}
if (bufsiz <= 0) {
return (-1);
}
md_node_count(mdp) <= 0) {
return (-1);
}
/*
* N1 MD contains cpu nodes while N2 MD contains component nodes.
*/
} else {
rc = -1;
}
return (rc);
}
void
{
int i;
}
procp++;
}
}
}