/*
* 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
*/
/*
*/
/*
* Main entry points for SUN4V Platform Independent topology enumerator
*/
#include <strings.h>
#include <fm/topo_mod.h>
#include <sys/systeminfo.h>
#include <bay.h>
#include <pi_impl.h>
/*
* Entry point called by libtopo when enumeration is required
*/
/*
* Entry point called by libtopo when a node is released.
*/
static void
/*
* Declare the operations vector and information structure used during
* module registration
*/
};
/*
* Called by libtopo when the topo module is loaded.
*/
void
{
int result;
/* Debugging is requested for this module */
}
/* see if we're being called to only generate authority */
if (version == TOPO_VERSION_AUTH_ONLY)
goto auth;
if (version != TOPO_VERSION) {
version);
return;
}
/* Verify that this is a SUN4V architecture machine */
return;
}
if (result < 0) {
/* module errno already set */
return;
}
auth:
else
}
/*
* Clean up any data used by the module before it is unloaded.
*/
void
{
/* Unregister from libtopo */
}
/*
* Topo node release entry point.
*/
static void
{
}
}
}
/*
* Enumeration entry point for the SUN4V topology enumerator
*/
/* ARGSUSED */
static int
{
int result;
int idx;
int num_components;
/* Begin enumeration */
/* Initialize the walker */
if (result != 0) {
return (-1);
}
/* Open a connection to the LDOM PRI */
if (result != 0) {
return (-1);
}
/*
* Find the top of the components graph in the PRI using the machine
* description library.
*/
/* No nodes were found */
return (-1);
}
/*
* There should be a single components node. But scan all of the
* results just in case a future machine has multiple hierarchies
* for some unknown reason.
*
* We continue to walk components nodes until they are all exhausted
* and do not stop if a node cannot be enumerated. Instead, we
* enumerate what we can and return a partial-enumeration error if
* there is a problem.
*/
result = 0;
int skip;
/*
* We have found a component hierarchy to process. First,
* make sure we are not supposed to skip the graph.
*/
if (skip == 0) {
/*
* We have found a components node. Find the top-
* level nodes and create a topology tree from them.
*/
}
}
/* Close our connection to the PRI */
/* Clean up after the walker */
/* Complete enumeration */
/* All done */
return (result);
}
/*
* This routined is called once for each mde node of type 'components'. It
* initiates enumeration of the graph starting with with this node.
*/
static int
{
int result;
int num_arcs;
int arcidx;
"walker failed to create node range with a NULL parent\n");
return (-1);
}
/* Determine how many children the given node has */
if (num_arcs == 0) {
/*
* This components node has no children and is not a topo
* node itself, so set partial enumeration and return.
*/
return (0);
}
/* Get the indexes for all the child nodes and put them in an array */
return (-1);
}
arcsize);
result = 0;
/*
* Initiate walking the PRI graph starting with the current
* child of the components node.
*/
if (result != 0) {
}
}
/*
* We have now walked the entire PRI graph. Execute any deferred
* enumeration routines that need all the nodes to be available.
*/
return (result);
}