/*
* 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 <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <limits.h>
#include <alloca.h>
#include <kstat.h>
#include <errno.h>
#include <libnvpair.h>
#include <sys/processor.h>
#include <sys/systeminfo.h>
#include <fm/topo_mod.h>
/*
* Enumerates the processing chips, or sockets, (as distinct from cores) in a
* system. For each chip found, the necessary nodes (one or more cores, and
* possibly a memory controller) are constructed underneath.
*/
#ifdef __cplusplus
extern "C" {
#endif
typedef struct chip {
} chip_t;
topo_instance_t, void *, void *);
int
{
if (getenv("TOPOCHIPDBG"))
return (-1);
return (-1);
}
return (-1);
}
return (-1);
}
return (0);
}
void
{
}
static int
{
return (-1);
} else {
}
return (ksp->ks_instance);
}
static nvlist_t *
{
int err;
return (NULL);
if (s != NULL)
if (err != 0) {
return (NULL);
}
return (asru);
}
/*ARGSUSED*/
static int
{
/*
* Override what was created for us
*/
< 0)
for (i = 0; i <= chip->chip_ncpustats; i++) {
continue;
"device_ID")) != NULL) {
s = sbuf;
} else {
s = NULL;
}
++nerr;
continue;
}
} else {
++nerr;
}
/*
* We look for a cpu_fru kstat. If one is available and
* it contains something useful, use it as the label and
* and the FRU.
*
* This is a problem for platforms that do not properly
* support the cpu_fru kstat like Ontario or if
* we start exporting a different type of FRU label
*/
"hc:///component=") != 0) {
char *lp;
&fru) == 0) {
}
== NULL) {
} else {
++lp;
}
} else {
}
}
if (nerr != 0)
else
return (0);
}
/*ARGSUSED*/
static int
{
return (0);
}