908f1e1388f616898b4e515d343c0414f2a6472esd * CDDL HEADER START
908f1e1388f616898b4e515d343c0414f2a6472esd * The contents of this file are subject to the terms of the
908f1e1388f616898b4e515d343c0414f2a6472esd * Common Development and Distribution License (the "License").
908f1e1388f616898b4e515d343c0414f2a6472esd * You may not use this file except in compliance with the License.
908f1e1388f616898b4e515d343c0414f2a6472esd * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
908f1e1388f616898b4e515d343c0414f2a6472esd * See the License for the specific language governing permissions
908f1e1388f616898b4e515d343c0414f2a6472esd * and limitations under the License.
908f1e1388f616898b4e515d343c0414f2a6472esd * When distributing Covered Code, include this CDDL HEADER in each
908f1e1388f616898b4e515d343c0414f2a6472esd * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
908f1e1388f616898b4e515d343c0414f2a6472esd * If applicable, add the following below this CDDL HEADER, with the
908f1e1388f616898b4e515d343c0414f2a6472esd * fields enclosed by brackets "[]" replaced with your own identifying
908f1e1388f616898b4e515d343c0414f2a6472esd * information: Portions Copyright [yyyy] [name of copyright owner]
908f1e1388f616898b4e515d343c0414f2a6472esd * CDDL HEADER END
908f1e1388f616898b4e515d343c0414f2a6472esd * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
908f1e1388f616898b4e515d343c0414f2a6472esd * Use is subject to license terms.
908f1e1388f616898b4e515d343c0414f2a6472esd#pragma ident "%Z%%M% %I% %E% SMI"
908f1e1388f616898b4e515d343c0414f2a6472esd * Open connections to the LDOM and Machine Description libraries used during
908f1e1388f616898b4e515d343c0414f2a6472esd * enumeration.
908f1e1388f616898b4e515d343c0414f2a6472esd * Initialize a connection to the LDOM machine description interface.
908f1e1388f616898b4e515d343c0414f2a6472esd return (-1);
908f1e1388f616898b4e515d343c0414f2a6472esd * Store the module pointer for this session. This file-global
908f1e1388f616898b4e515d343c0414f2a6472esd * is used by the allocators called by libldom and libmdesc.
908f1e1388f616898b4e515d343c0414f2a6472esd /* Initialize the LDOM connection */
908f1e1388f616898b4e515d343c0414f2a6472esd "sun4vpi failed to initialize LDOM layer.\n");
908f1e1388f616898b4e515d343c0414f2a6472esd return (-1);
908f1e1388f616898b4e515d343c0414f2a6472esd /* Initialize the machine description layer for this ldom instance */
908f1e1388f616898b4e515d343c0414f2a6472esd pip->ldom_bufsize = ldom_get_core_md(pip->ldomp, &(pip->ldom_bufp));
908f1e1388f616898b4e515d343c0414f2a6472esd topo_mod_dprintf(mod, "ldom_get_core_md error: bufsize = %d\n",
908f1e1388f616898b4e515d343c0414f2a6472esd return (-1);
908f1e1388f616898b4e515d343c0414f2a6472esd /* Initialize the machine description internal layer */
908f1e1388f616898b4e515d343c0414f2a6472esd pip->mdp = md_init_intern(pip->ldom_bufp, pi_alloc, pi_free);
908f1e1388f616898b4e515d343c0414f2a6472esd return (-1);
908f1e1388f616898b4e515d343c0414f2a6472esd return (0);
908f1e1388f616898b4e515d343c0414f2a6472esd/* ARGSUSED */
908f1e1388f616898b4e515d343c0414f2a6472esd /* Close the machine description connection */
908f1e1388f616898b4e515d343c0414f2a6472esd /* Close the connection to the LDOM layer */
908f1e1388f616898b4e515d343c0414f2a6472esd /* Free the ldom connection data */
908f1e1388f616898b4e515d343c0414f2a6472esd /* Reset the file-global module pointer */
908f1e1388f616898b4e515d343c0414f2a6472esdstatic void *
908f1e1388f616898b4e515d343c0414f2a6472esd /* Cannot allocate memory without a module pointer */
908f1e1388f616898b4e515d343c0414f2a6472esdstatic void
908f1e1388f616898b4e515d343c0414f2a6472esd /* Cannot free memory without a module pointer */