pi_impl.h revision 9c94f155585ea35e938fea603bc227c685223abd
/*
* 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.
*/
#ifndef _PI_IMPL_H
#define _PI_IMPL_H
/*
* SUN4V Platform Independent Enumerator private interfaces
*/
#ifdef __cplusplus
extern "C" {
#endif
#include <pthread.h>
#include <libuutil.h>
#include <fm/topo_mod.h>
/* Definitions used when registering the enumerator with libtopo */
#define SUN4VPI_DESC "SUN4V Platform independent topology enumerator"
#define SUN4VPI_SCHEME "hc"
#define SUN4VPI_VERSION TOPO_VERSION
/* Flags used by pi_enum_generic_impl */
/* Definitions used when working with PRI machine description nodes */
#define MD_STR_BACK "back"
#define MD_STR_CHIP "chip"
#define MD_STR_CHASSIS "chassis"
#define MD_STR_FWD "fwd"
#define MD_STR_NAME "name"
#define MD_STR_PATH "path"
#define MD_STR_PLATFORM "platform"
#define MD_STR_TYPE "type"
/*
* The enumerator needs to pass some state in to the function that walks
* the PRI graph. This structure contains the necessary information.
*/
struct pi_enum_s {
int md_nodes; /* Number of md nodes */
void *wp; /* Walker private data */
};
/*
* Some node types require custom functions to create their topology nodes.
* This function prototype defines the interface to these functions.
*/
/*
* Some enumeration functions may need to defer execution until after the
* entire PRI graph has been walked for some nodes. This interface is
* provided to allow for the registration of routines to execute after the
* entire graph has been walked (for example, to execute sub-enumerators).
*/
pi_deferenum_fn_t, void *);
/* Decorate a PCI-E node. */
const char *);
/* Functions to handle LDOM PRI sessions */
/* Walk the PRI and create a topology starting at a particular PRI node */
int pi_walker_init(topo_mod_t *);
void pi_walker_fini(topo_mod_t *);
/* PRI machine description node data access routines */
mde_cookie_t **, size_t *);
char *pi_get_serverid(topo_mod_t *);
const char *, topo_instance_t, nvlist_t *);
#ifdef __cplusplus
}
#endif
#endif /* _PI_IMPL_H */