17aec1d6eScindi /*
27aec1d6eScindi  * CDDL HEADER START
37aec1d6eScindi  *
47aec1d6eScindi  * The contents of this file are subject to the terms of the
50eb822a1Scindi  * Common Development and Distribution License (the "License").
60eb822a1Scindi  * You may not use this file except in compliance with the License.
77aec1d6eScindi  *
87aec1d6eScindi  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97aec1d6eScindi  * or http://www.opensolaris.org/os/licensing.
107aec1d6eScindi  * See the License for the specific language governing permissions
117aec1d6eScindi  * and limitations under the License.
127aec1d6eScindi  *
137aec1d6eScindi  * When distributing Covered Code, include this CDDL HEADER in each
147aec1d6eScindi  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157aec1d6eScindi  * If applicable, add the following below this CDDL HEADER, with the
167aec1d6eScindi  * fields enclosed by brackets "[]" replaced with your own identifying
177aec1d6eScindi  * information: Portions Copyright [yyyy] [name of copyright owner]
187aec1d6eScindi  *
197aec1d6eScindi  * CDDL HEADER END
207aec1d6eScindi  */
217aec1d6eScindi /*
22f6e214c7SGavin Maltby  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
23*c5591576SRob Johnston  * Copyright 2020 Joyent, Inc.
247aec1d6eScindi  */
267aec1d6eScindi /*
277aec1d6eScindi  * Topology Nodes
287aec1d6eScindi  *
297aec1d6eScindi  * Topology nodes, tnode_t, are data structures containing per-FMRI
307aec1d6eScindi  * information and are linked together to form the topology tree.
317aec1d6eScindi  * Nodes are created during the enumeration process of topo_snap_hold()
327aec1d6eScindi  * and destroyed during topo_snap_rele().  For the most part, tnode_t data
337aec1d6eScindi  * is read-only and no lock protection is required.  Nodes are
347aec1d6eScindi  * held in place during tree walk functions.  Tree walk functions
357aec1d6eScindi  * may access node data safely without locks.  The exception to this rule
367aec1d6eScindi  * is data associated with node properties (topo_prop.c).  Properties
377aec1d6eScindi  * may change at anytime and are protected by a per-property locking
387aec1d6eScindi  * strategy.
397aec1d6eScindi  *
40c40d7343Scindi  * Enumerator plugin modules may also safely access topology nodes within their
41c40d7343Scindi  * scope of operation: the parent node passed into the enumeration op or those