/*
* 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
*/
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <fm/topo_mod.h>
#include <unistd.h>
#include <fcntl.h>
#include <umem.h>
#include <cpu_mdesc.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.
*/
extern topo_method_t pi_chip_methods[];
/* Forward declaration */
topo_instance_t, void *, void *);
{ chip_enum, chip_release };
1
};
int
{
if (getenv("TOPOCHIPDBG"))
return (-1);
return (-1);
}
return (-1);
}
return (0);
}
void
{
}
static tnode_t *
{
int err;
/* chassis auth */
(void) nvlist_add_string(auth,
} else {
}
(void) nvlist_add_string(auth,
} else {
}
(void) nvlist_add_string(auth,
} else {
}
(void) nvlist_add_string(auth,
} else {
}
(void) nvlist_add_string(auth,
} else {
}
}
"Unable to make nvlist for %s bind: %s.\n",
return (NULL);
}
"topo_node_bind (%s%d/%s%d) failed: %s\n",
name, i,
return (NULL);
}
/* chassis */
}
/* Inherit the Label FRU fields from the parent */
/* Register retire methods */
"for %s%d/%s%d: %s\n",
return (ntn);
}
static nvlist_t *
{
int err;
return (NULL);
if (err != 0) {
return (NULL);
}
return (fmri);
}
/*ARGSUSED*/
static int
{
int i;
int err;
int nerr = 0;
int pid;
/*
*/
continue;
}
return (-1);
}
return (-1);
}
/*
* Create the cpu[i] nodes of a given cmp i
*/
if (mcmp->cpumap_serialno == 0 ||
continue;
}
/* physical cpuid */
"failed to create a cpu=%d node: %s\n",
nerr++;
continue;
}
} else {
nerr++;
}
}
if (nerr != 0)
return (0);
}
static int
{
"Currently only know how to enumerate %s components.\n",
CHIP);
return (0);
}
"Calling dimm_enum\n");
if (topo_mod_enumerate(mod,
}
return (0);
}
static topo_mod_t *
{
"%s enumerator could not load %s enum. (%d: %s)\n",
}
return (rp);
}
/*ARGSUSED*/
static int
{
int nerr = 0;
int err;
int i;
return (-1);
}
return (-1);
/*
* Create the chip[i] nodes, one for each CMP chip uniquely identified
* by the serial number.
*/
/* Skip the processors with no serial number */
continue;
}
continue;
}
nerr++;
continue;
}
/* Enumerate all cpu strands of this CMP chip */
if (err != 0) {
nerr++;
}
/* Enumerate all DIMMs belonging to this chip */
return (-1);
}
}
if (nerr != 0)
return (0);
}
/*ARGSUSED*/
static int
{
return (0);
}
/*ARGSUSED*/
static void
{
}