/titanic_50/usr/src/lib/fm/topo/libtopo/common/ |
H A D | topo_snap.c | 94 set_open_errno(topo_hdl_t *thp, int *errp, int err) in set_open_errno() argument 96 if (thp != NULL) { in set_open_errno() 97 topo_close(thp); in set_open_errno() 107 topo_hdl_t *thp = NULL; in topo_open() local 123 return (set_open_errno(thp, errp, ETOPO_HDL_ABIVER)); in topo_open() 126 return (set_open_errno(thp, errp, ETOPO_HDL_INVAL)); in topo_open() 128 if ((thp = topo_zalloc(sizeof (topo_hdl_t), 0)) == NULL) in topo_open() 129 return (set_open_errno(thp, errp, ETOPO_NOMEM)); in topo_open() 131 (void) pthread_mutex_init(&thp->th_lock, NULL); in topo_open() 134 return (set_open_errno(thp, errp, ETOPO_NOMEM)); in topo_open() [all …]
|
H A D | topo_fmri.c | 75 set_error(topo_hdl_t *thp, int err, int *errp, char *method, nvlist_t *nvlp) in set_error() argument 79 topo_dprintf(thp, TOPO_DBG_ERR, "%s failed: %s\n", method, in set_error() 88 set_nverror(topo_hdl_t *thp, int err, int *errp, char *method, nvlist_t *nvlp) in set_nverror() argument 92 topo_dprintf(thp, TOPO_DBG_ERR, "%s failed: %s\n", method, in set_nverror() 100 topo_fmri_nvl2str(topo_hdl_t *thp, nvlist_t *fmri, char **fmristr, int *err) in topo_fmri_nvl2str() argument 107 return (set_error(thp, ETOPO_FMRI_MALFORM, err, in topo_fmri_nvl2str() 110 if ((rnode = topo_hdl_root(thp, scheme)) == NULL) in topo_fmri_nvl2str() 111 return (set_error(thp, ETOPO_METHOD_NOTSUP, err, in topo_fmri_nvl2str() 116 return (set_error(thp, *err, err, TOPO_METH_NVL2STR, out)); in topo_fmri_nvl2str() 119 return (set_error(thp, ETOPO_METHOD_INVAL, err, in topo_fmri_nvl2str() [all …]
|
H A D | topo_module.c | 165 topo_mod_lookup(topo_hdl_t *thp, const char *name, int bump) in topo_mod_lookup() argument 168 topo_modhash_t *mhp = thp->th_modhash; in topo_mod_lookup() 182 topo_hdl_t *thp = mod->tm_hdl; in topo_mod_destroy() local 191 topo_hdl_strfree(thp, mod->tm_name); in topo_mod_destroy() 193 topo_hdl_strfree(thp, mod->tm_path); in topo_mod_destroy() 195 topo_hdl_strfree(thp, mod->tm_rootdir); in topo_mod_destroy() 197 topo_hdl_free(thp, mod, sizeof (topo_mod_t)); in topo_mod_destroy() 201 set_create_error(topo_hdl_t *thp, topo_mod_t *mod, const char *path, int err) in set_create_error() argument 204 topo_dprintf(thp, TOPO_DBG_ERR, "unable to load module %s: " in set_create_error() 207 topo_dprintf(thp, TOPO_DBG_ERR, "unable to load module: " in set_create_error() [all …]
|
H A D | topo_tree.c | 70 set_create_error(topo_hdl_t *thp, ttree_t *tp, int err) in set_create_error() argument 76 (void) topo_hdl_seterrno(thp, err); in set_create_error() 82 topo_tree_create(topo_hdl_t *thp, topo_mod_t *mod, const char *scheme) in topo_tree_create() argument 88 return (set_create_error(thp, NULL, ETOPO_NOMEM)); in topo_tree_create() 93 return (set_create_error(thp, tp, ETOPO_NOMEM)); in topo_tree_create() 99 return (set_create_error(thp, tp, ETOPO_NOMEM)); in topo_tree_create() 105 return (set_create_error(thp, tp, 0)); /* th_errno set */ in topo_tree_create() 111 rp->tn_hdl = thp; in topo_tree_create() 116 tp->tt_walk->tw_thp = thp; in topo_tree_create() 153 topo_tree_enum(topo_hdl_t *thp, ttree_t *tp) in topo_tree_enum() argument [all …]
|
H A D | topo_subr.c | 37 topo_hdl_lock(topo_hdl_t *thp) in topo_hdl_lock() argument 39 (void) pthread_mutex_lock(&thp->th_lock); in topo_hdl_lock() 43 topo_hdl_unlock(topo_hdl_t *thp) in topo_hdl_unlock() argument 45 (void) pthread_mutex_unlock(&thp->th_lock); in topo_hdl_unlock() 106 env_process_value(topo_hdl_t *thp, const char *begin, const char *end) in env_process_value() argument 132 thp->th_debug |= dbp->tdm_mode; in env_process_value() 137 topo_debug_set(topo_hdl_t *thp, const char *dbmode, const char *dout) in topo_debug_set() argument 142 topo_hdl_lock(thp); in topo_debug_set() 152 env_process_value(thp, value, end); in topo_debug_set() 156 topo_hdl_unlock(thp); in topo_debug_set() [all …]
|
H A D | topo_2xml.c | 105 txml_print_prop(topo_hdl_t *thp, FILE *fp, tnode_t *node, const char *pgname, in txml_print_prop() argument 171 if (topo_fmri_nvl2str(thp, val, &fmri, &err) in txml_print_prop() 195 topo_hdl_free(thp, val, in txml_print_prop() 205 topo_hdl_free(thp, val, in txml_print_prop() 220 topo_hdl_strfree(thp, pval); in txml_print_prop() 223 topo_hdl_strfree(thp, fmri); in txml_print_prop() 230 txml_print_pgroup(topo_hdl_t *thp, FILE *fp, tnode_t *node, topo_pgroup_t *pg) in txml_print_pgroup() argument 244 txml_print_prop(thp, fp, node, pip->tpi_name, plp->tp_pval); in txml_print_pgroup() 250 txml_print_dependents(topo_hdl_t *thp, FILE *fp, tnode_t *node) in txml_print_dependents() argument 255 if (txml_print_range(thp, fp, node, 1) == 1) in txml_print_dependents() [all …]
|
H A D | topo_prop.c | 208 topo_hdl_t *thp = node->tn_hdl; in prop_getval() local 247 if ((s2 = topo_hdl_strdup(thp, str)) == NULL) in prop_getval() 260 ret = topo_hdl_nvdup(thp, nvl, in prop_getval() 270 if ((a1 = topo_hdl_alloc(thp, sizeof (int32_t) * in prop_getval() 286 if ((a1 = topo_hdl_alloc(thp, sizeof (uint32_t) * in prop_getval() 302 if ((a1 = topo_hdl_alloc(thp, sizeof (int64_t) * in prop_getval() 318 if ((a1 = topo_hdl_alloc(thp, sizeof (uint64_t) * in prop_getval() 334 if ((a1 = topo_hdl_alloc(thp, sizeof (char *) * in prop_getval() 340 if ((a1[i] = topo_hdl_strdup(thp, a2[i])) in prop_getval() 343 topo_hdl_free(thp, a1[j], in prop_getval() [all …]
|
H A D | topo_builtin.c | 102 topo_builtin_create(topo_hdl_t *thp, const char *rootdir) in topo_builtin_create() argument 117 if ((mod = topo_modhash_load(thp, bp->bltin_name, NULL, in topo_builtin_create() 119 topo_dprintf(thp, TOPO_DBG_ERR, in topo_builtin_create() 122 topo_hdl_errmsg(thp)); in topo_builtin_create() 125 if ((tp = topo_tree_create(thp, mod, bp->bltin_name)) in topo_builtin_create() 127 topo_dprintf(thp, TOPO_DBG_ERR, in topo_builtin_create() 130 topo_hdl_errmsg(thp)); in topo_builtin_create() 133 topo_list_append(&thp->th_trees, tp); in topo_builtin_create() 147 (void) topo_hdl_seterrno(thp, ETOPO_ENUM_PARTIAL); in topo_builtin_create()
|
H A D | topo_alloc.c | 58 topo_hdl_alloc(topo_hdl_t *thp, size_t size) in topo_hdl_alloc() argument 60 topo_alloc_t *ap = thp->th_alloc; in topo_hdl_alloc() 66 topo_hdl_zalloc(topo_hdl_t *thp, size_t size) in topo_hdl_zalloc() argument 68 topo_alloc_t *ap = thp->th_alloc; in topo_hdl_zalloc() 74 topo_hdl_free(topo_hdl_t *thp, void *data, size_t size) in topo_hdl_free() argument 76 topo_alloc_t *ap = thp->th_alloc; in topo_hdl_free()
|
/titanic_50/usr/src/cmd/fm/schemes/dev/ |
H A D | scheme.c | 52 topo_hdl_t *thp; in fmd_fmri_nvl2str() local 55 if ((thp = fmd_fmri_topo_hold(TOPO_VERSION)) == NULL) in fmd_fmri_nvl2str() 58 if (topo_fmri_nvl2str(thp, nvl, &str, &err) != 0) { in fmd_fmri_nvl2str() 59 fmd_fmri_topo_rele(thp); in fmd_fmri_nvl2str() 68 topo_hdl_strfree(thp, str); in fmd_fmri_nvl2str() 69 fmd_fmri_topo_rele(thp); in fmd_fmri_nvl2str() 78 topo_hdl_t *thp; in fmd_fmri_present() local 80 if ((thp = fmd_fmri_topo_hold(TOPO_VERSION)) == NULL) in fmd_fmri_present() 83 present = topo_fmri_present(thp, nvl, &err); in fmd_fmri_present() 84 fmd_fmri_topo_rele(thp); in fmd_fmri_present() [all …]
|
/titanic_50/usr/src/cmd/fm/schemes/svc/ |
H A D | scheme.c | 49 topo_hdl_t *thp; in fmd_fmri_nvl2str() local 52 if ((thp = fmd_fmri_topo_hold(TOPO_VERSION)) == NULL) in fmd_fmri_nvl2str() 55 if (topo_fmri_nvl2str(thp, nvl, &str, &err) != 0) { in fmd_fmri_nvl2str() 56 fmd_fmri_topo_rele(thp); in fmd_fmri_nvl2str() 65 topo_hdl_strfree(thp, str); in fmd_fmri_nvl2str() 66 fmd_fmri_topo_rele(thp); in fmd_fmri_nvl2str() 77 topo_hdl_t *thp; in fmd_fmri_present() local 83 if ((thp = fmd_fmri_topo_hold(TOPO_VERSION)) == NULL) in fmd_fmri_present() 85 present = topo_fmri_present(thp, nvl, &err); in fmd_fmri_present() 86 fmd_fmri_topo_rele(thp); in fmd_fmri_present() [all …]
|
/titanic_50/usr/src/cmd/fm/schemes/hc/ |
H A D | scheme.c | 47 topo_hdl_t *thp; in fmd_fmri_nvl2str() local 54 if ((thp = fmd_fmri_topo_hold(TOPO_VERSION)) == NULL) in fmd_fmri_nvl2str() 56 if (topo_fmri_nvl2str(thp, nvl, &str, &err) != 0) { in fmd_fmri_nvl2str() 57 fmd_fmri_topo_rele(thp); in fmd_fmri_nvl2str() 66 topo_hdl_strfree(thp, str); in fmd_fmri_nvl2str() 67 fmd_fmri_topo_rele(thp); in fmd_fmri_nvl2str() 76 topo_hdl_t *thp; in fmd_fmri_present() local 88 if ((thp = fmd_fmri_topo_hold(TOPO_VERSION)) == NULL) in fmd_fmri_present() 90 present = topo_fmri_present(thp, nvl, &err); in fmd_fmri_present() 91 fmd_fmri_topo_rele(thp); in fmd_fmri_present() [all …]
|
/titanic_50/usr/src/cmd/fm/fmtopo/common/ |
H A D | fmtopo.c | 128 print_node(topo_hdl_t *thp, tnode_t *node, nvlist_t *nvl, const char *fmri) in print_node() argument 140 (void) topo_fmri_nvl2str(thp, asru, &aname, &err); in print_node() 142 (void) topo_fmri_nvl2str(thp, fru, &fname, &err); in print_node() 147 topo_hdl_strfree(thp, aname); in print_node() 154 topo_hdl_strfree(thp, fname); in print_node() 160 topo_hdl_strfree(thp, lname); in print_node() 167 if ((ret = topo_fmri_present(thp, nvl, &err)) < 0) in print_node() 173 if ((ret = topo_fmri_unusable(thp, nvl, &err)) < 0) in print_node() 239 print_prop_nameval(topo_hdl_t *thp, tnode_t *node, nvlist_t *nvl) in print_prop_nameval() argument 404 if (topo_fmri_nvl2str(thp, val, &fmri, &err) != 0) { in print_prop_nameval() [all …]
|
/titanic_50/usr/src/cmd/fm/schemes/mem/ |
H A D | mem.c | 153 topo_hdl_t *thp; in fmd_fmri_expand() local 161 if ((thp = fmd_fmri_topo_hold(TOPO_VERSION)) == NULL) in fmd_fmri_expand() 163 rc = topo_fmri_expand(thp, nvl, &err); in fmd_fmri_expand() 164 fmd_fmri_topo_rele(thp); in fmd_fmri_expand() 216 struct topo_hdl *thp; in fmd_fmri_present() local 234 if ((thp = fmd_fmri_topo_hold(TOPO_VERSION)) == NULL) in fmd_fmri_present() 236 rc = topo_fmri_present(thp, nvl, &err); in fmd_fmri_present() 237 fmd_fmri_topo_rele(thp); in fmd_fmri_present() 284 if ((thp = fmd_fmri_topo_hold(TOPO_VERSION)) == NULL) { in fmd_fmri_present() 288 if (topo_fmri_str2nvl(thp, unum, &unum_nvl, &err) == 0) { in fmd_fmri_present() [all …]
|
/titanic_50/usr/src/cmd/fm/schemes/cpu/ |
H A D | cpu.c | 46 topo_hdl_t *thp; in fmd_fmri_nvl2str() local 49 if ((thp = fmd_fmri_topo_hold(TOPO_VERSION)) == NULL) in fmd_fmri_nvl2str() 51 if (topo_fmri_nvl2str(thp, nvl, &str, &err) != 0) { in fmd_fmri_nvl2str() 52 fmd_fmri_topo_rele(thp); in fmd_fmri_nvl2str() 59 topo_hdl_strfree(thp, str); in fmd_fmri_nvl2str() 60 fmd_fmri_topo_rele(thp); in fmd_fmri_nvl2str() 151 topo_hdl_t *thp; in fmd_fmri_expand() local 160 if ((thp = fmd_fmri_topo_hold(TOPO_VERSION)) == NULL) in fmd_fmri_expand() 163 rc = topo_fmri_expand(thp, nvl, &err); in fmd_fmri_expand() 164 fmd_fmri_topo_rele(thp); in fmd_fmri_expand() [all …]
|
/titanic_50/usr/src/cmd/prtdiag/i386/ |
H A D | smbios.c | 173 do_slot_mapping_cb(topo_hdl_t *thp, tnode_t *node, void *arg) in do_slot_mapping_cb() argument 185 if (topo_fmri_nvl2str(thp, rsrc, &fmri, &err) < 0) in do_slot_mapping_cb() 234 topo_hdl_strfree(thp, didstr); in do_slot_mapping_cb() 235 topo_hdl_strfree(thp, driver); in do_slot_mapping_cb() 236 topo_hdl_strfree(thp, vidstr); in do_slot_mapping_cb() 237 topo_hdl_strfree(thp, fmri); in do_slot_mapping_cb() 243 do_slot_mapping(smbios_slot_t *s, topo_hdl_t *thp) in do_slot_mapping() argument 259 twp = topo_walk_init(thp, FM_FMRI_SCHEME_HC, do_slot_mapping_cb, pciex, in do_slot_mapping() 309 topo_hdl_t *thp; in do_prominfo() local 354 if ((thp = topo_open(TOPO_VERSION, NULL, &err)) != NULL) { in do_prominfo() [all …]
|
/titanic_50/usr/src/cmd/fm/modules/common/disk-monitor/ |
H A D | topo_gather.c | 194 fmri2ptr(topo_hdl_t *thp, tnode_t *node, char **str, int *err) in fmri2ptr() argument 204 if (topo_fmri_nvl2str(thp, fmri, &cstr, err) != 0) { in fmri2ptr() 217 topo_hdl_strfree(thp, cstr); in fmri2ptr() 227 topo_add_disk(topo_hdl_t *thp, tnode_t *node, walk_diskmon_t *wdp) in topo_add_disk() argument 272 topo_hdl_strfree(thp, label); in topo_add_disk() 290 topo_hdl_strfree(thp, devpath); in topo_add_disk() 300 topo_hdl_strfree(thp, devpath); in topo_add_disk() 327 topo_hdl_strfree(thp, model); in topo_add_disk() 329 topo_hdl_strfree(thp, manuf); in topo_add_disk() 331 topo_hdl_strfree(thp, serial); in topo_add_disk() [all …]
|
/titanic_50/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/ |
H A D | cmd_hc_sun4v.c | 279 find_mb(topo_hdl_t *thp, tnode_t *node, void *arg) in find_mb() argument 316 topo_hdl_t *thp; in init_mb() local 320 if ((thp = fmd_hdl_topo_hold(hdl, TOPO_VERSION)) == NULL) in init_mb() 322 if ((twp = topo_walk_init(thp, in init_mb() 325 fmd_hdl_topo_rele(hdl, thp); in init_mb() 330 fmd_hdl_topo_rele(hdl, thp); in init_mb() 336 find_dimm_sn_mem(topo_hdl_t *thp, tnode_t *node, void *arg) in find_dimm_sn_mem() argument 362 find_dimm_sn_hc(topo_hdl_t *thp, tnode_t *node, void *arg) in find_dimm_sn_hc() argument 389 topo_hdl_t *thp; in cmd_find_dimm_by_sn() local 395 if ((thp = fmd_hdl_topo_hold(hdl, TOPO_VERSION)) == NULL) in cmd_find_dimm_by_sn() [all …]
|
/titanic_50/usr/src/cmd/fm/schemes/mod/ |
H A D | scheme.c | 35 topo_hdl_t *thp; in fmd_fmri_nvl2str() local 38 if ((thp = fmd_fmri_topo_hold(TOPO_VERSION)) == NULL) in fmd_fmri_nvl2str() 41 if (topo_fmri_nvl2str(thp, nvl, &str, &err) != 0) { in fmd_fmri_nvl2str() 42 fmd_fmri_topo_rele(thp); in fmd_fmri_nvl2str() 51 topo_hdl_strfree(thp, str); in fmd_fmri_nvl2str() 52 fmd_fmri_topo_rele(thp); in fmd_fmri_nvl2str()
|
/titanic_50/usr/src/cmd/fm/schemes/pkg/ |
H A D | scheme.c | 35 topo_hdl_t *thp; in fmd_fmri_nvl2str() local 38 if ((thp = fmd_fmri_topo_hold(TOPO_VERSION)) == NULL) in fmd_fmri_nvl2str() 41 if (topo_fmri_nvl2str(thp, nvl, &str, &err) != 0) { in fmd_fmri_nvl2str() 42 fmd_fmri_topo_rele(thp); in fmd_fmri_nvl2str() 51 topo_hdl_strfree(thp, str); in fmd_fmri_nvl2str() 52 fmd_fmri_topo_rele(thp); in fmd_fmri_nvl2str()
|
/titanic_50/usr/src/cmd/fm/schemes/sw/ |
H A D | scheme.c | 48 topo_hdl_t *thp; in fmd_fmri_nvl2str() local 51 if ((thp = fmd_fmri_topo_hold(TOPO_VERSION)) == NULL) in fmd_fmri_nvl2str() 54 if (topo_fmri_nvl2str(thp, nvl, &str, &err) != 0) { in fmd_fmri_nvl2str() 55 fmd_fmri_topo_rele(thp); in fmd_fmri_nvl2str() 64 topo_hdl_strfree(thp, str); in fmd_fmri_nvl2str() 65 fmd_fmri_topo_rele(thp); in fmd_fmri_nvl2str()
|
/titanic_50/usr/src/cmd/fm/modules/common/disk-lights/ |
H A D | disk_lights.c | 137 dl_fault_walk_inner(topo_hdl_t *thp, tnode_t *node, void *arg) in dl_fault_walk_inner() argument 147 get_facility_props(thp, node, &facname, &factype) != 0) { in dl_fault_walk_inner() 162 topo_hdl_strfree(thp, facname); in dl_fault_walk_inner() 163 topo_hdl_strfree(thp, factype); in dl_fault_walk_inner() 168 dl_fault_walk_outer(topo_hdl_t *thp, tnode_t *node, void *arg) in dl_fault_walk_outer() argument 203 (void) topo_node_child_walk(thp, pnode, dl_fault_walk_inner, &fwi, in dl_fault_walk_outer() 218 topo_hdl_t *thp = NULL; in dl_examine_topo() local 221 thp = fmd_hdl_topo_hold(dl->dl_fmd, TOPO_VERSION); in dl_examine_topo() 222 if ((twp = topo_walk_init(thp, FM_FMRI_SCHEME_HC, dl_fault_walk_outer, in dl_examine_topo() 238 if (thp != NULL) in dl_examine_topo() [all …]
|
/titanic_50/usr/src/lib/libzfs/common/ |
H A D | libzfs_fru.c | 104 libzfs_fru_gather(topo_hdl_t *thp, tnode_t *tn, void *arg) in libzfs_fru_gather() argument 138 _topo_hdl_strfree(thp, devpath); in libzfs_fru_gather() 143 _topo_hdl_strfree(thp, devpath); in libzfs_fru_gather() 150 if (_topo_fmri_nvl2str(thp, fru, &frustr, &err) != 0) { in libzfs_fru_gather() 152 _topo_hdl_strfree(thp, devpath); in libzfs_fru_gather() 162 _topo_hdl_strfree(thp, devpath); in libzfs_fru_gather() 163 _topo_hdl_strfree(thp, frustr); in libzfs_fru_gather() 171 _topo_hdl_strfree(thp, devpath); in libzfs_fru_gather() 172 _topo_hdl_strfree(thp, frustr); in libzfs_fru_gather() 176 _topo_hdl_strfree(thp, devpath); in libzfs_fru_gather() [all …]
|
/titanic_50/usr/src/cmd/fm/modules/common/sw-diag-response/subsidiary/smf/ |
H A D | smf_util.c | 44 topo_hdl_t *thp; in sw_smf_svcfmri2str() local 48 thp = fmd_hdl_topo_hold(hdl, TOPO_VERSION); in sw_smf_svcfmri2str() 49 if (topo_fmri_nvl2str(thp, fmri, &topostr, &err) == 0) { in sw_smf_svcfmri2str() 51 topo_hdl_strfree(thp, topostr); in sw_smf_svcfmri2str() 53 fmd_hdl_topo_rele(hdl, thp); in sw_smf_svcfmri2str()
|
/titanic_50/usr/src/cmd/fm/modules/common/disk-transport/ |
H A D | disk_transport.c | 109 dt_analyze_disk(topo_hdl_t *thp, tnode_t *node, void *arg) in dt_analyze_disk() argument 129 if (topo_hdl_nvalloc(thp, &in, NV_UNIQUE_NAME) != 0) { in dt_analyze_disk() 136 if (topo_fmri_nvl2str(thp, fmri, &fmristr, &err) == 0 && in dt_analyze_disk() 139 topo_hdl_strfree(thp, fmristr); in dt_analyze_disk() 192 topo_hdl_t *thp; in dt_timeout() local 199 thp = fmd_hdl_topo_hold(hdl, TOPO_VERSION); in dt_timeout() 200 if ((twp = topo_walk_init(thp, FM_FMRI_SCHEME_HC, dt_analyze_disk, in dt_timeout() 202 fmd_hdl_topo_rele(hdl, thp); in dt_timeout() 210 fmd_hdl_topo_rele(hdl, thp); in dt_timeout() 216 fmd_hdl_topo_rele(hdl, thp); in dt_timeout() [all …]
|