2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * Enumerates the DIMMS in a system. For each DIMM found, the necessary nodes 2N/A * are also constructed. 2N/A/* Forward declaration */ "Unable to make nvlist for %s bind: %s.\n",
"topo_node_bind (%s%d/%s%d) failed: %s\n",
{
"dram-channel",
"CH%d" },
* Because mem_tnode_create will fill in a "FRU" value by default, * but not an "ASRU" value, we have to compute the desired "FRU" * value -before- calling mem_tnode_create, but it's ok to * topo_mod_asru_set() the ASRU value after the topo_node is /* ASRU will be computed by topo method */ const char *t = s +
start;
return (t - s);
/* next slash */ * mem_range_create and mem_inst_create are mutually recursive routines which * together create the node hierarchy for one dimm and its siblings. * mem_range_create is called when creating the first instance of a given node * type as child of a parent instance, because it is then, and only then, * that a topo range must be created. It calls mem_inst_create for its first * and subsequent instances. The recursion always starts with * mem_range_create, so it performs the up-front sanity checks. * Note: the list of mem_dimm_map_t's pointed at by dp must be sorted * alphabetically by *dm_label. }
else if (*(d->
dm_label +
pfnext) ==
'\0') {
/* this node has a fru */ d =
dp->
dm_next;
/* next mem_dimm_map_t could be child */ return (
1);
/* definitely an error */ return (
1);
/* recursed too far */ * Skip over NAC elements other than those listed * above. These elements will appear * in the DIMM's unum, but not in hc: scheme hierarchy. continue;
/* child of 1st instance -- already done */ pflen) == 0) {
/* child of same parent */ * Same nodename as sibling. Don't create * new range, or the enumeration will die. return (
nerr);
/* finished all children of my parent */ return (
nerr);
/* reached end of mem_dimm_map_t list */ char nodename[
10];
/* allows up to 10^6 chips in system */ l =
3;
/* start with MEM */ * The hc-scheme memory enumerator is invoked from within a platform * toplogy file. Make sure that the invocation is either * 1) a child of the chip enumerator, which will cause the argument "rnode" * below to be a chip node, and the dimm structures specific for that chip can * then be built from its specific node, or * 2) a child of the motherboard enumerator -- for Batoka and similar machines