7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * CDDL HEADER START
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * The contents of this file are subject to the terms of the
74a31ce69a88d851777ca840d31ec610ce9ecab3timh * Common Development and Distribution License (the "License").
74a31ce69a88d851777ca840d31ec610ce9ecab3timh * You may not use this file except in compliance with the License.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * See the License for the specific language governing permissions
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * and limitations under the License.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * When distributing Covered Code, include this CDDL HEADER in each
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * If applicable, add the following below this CDDL HEADER, with the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * fields enclosed by brackets "[]" replaced with your own identifying
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * information: Portions Copyright [yyyy] [name of copyright owner]
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * CDDL HEADER END
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi { "hc", HC_VERSION, hc_init, hc_fini }, /* hc must go last */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi for (bp = _topo_builtins; bp->bltin_name != NULL; bp++) {
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if ((*bp->bltin_init)(mp, version) != 0 || mp->tm_info == NULL) {
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi "unable initialize builtin module: %s: %s\n",
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi return (-1);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi return (0);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi return (0);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*ARGSUSED*/
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditopo_builtin_create(topo_hdl_t *thp, const char *rootdir)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Create a scheme-specific topo tree for all builtins
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi for (bp = _topo_builtins; bp->bltin_name != NULL; bp++) {
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Load scheme-specific module
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if ((mod = topo_modhash_load(thp, bp->bltin_name, NULL,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi "unable to create scheme "
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi return (-1);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi "unable to create scheme "
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi return (-1);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Call the enumerator on the root of the tree, with the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * scheme name as the name to enumerate. This will
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * establish methods on the root node.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi if (topo_mod_enumerate(mod, rnode, mod->tm_name, rnode->tn_name,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * If we see a failure, note it in the handle and
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi return (0);