Lines Matching refs:mod

75 _topo_init(topo_mod_t *mod)
80 topo_mod_setdebug(mod);
81 topo_mod_dprintf(mod, "initializing chip enumerator\n");
83 if ((chip = topo_mod_zalloc(mod, sizeof (md_info_t))) == NULL)
86 if (cpu_mdesc_init(mod, chip) != 0) {
87 topo_mod_dprintf(mod, "failed to get cpus from the PRI/MD\n");
88 topo_mod_free(mod, chip, sizeof (md_info_t));
92 topo_mod_setspecific(mod, (void *)chip);
94 if (topo_mod_register(mod, &chip_info, TOPO_VERSION) != 0) {
95 topo_mod_dprintf(mod, "failed to register hc: "
96 "%s\n", topo_mod_errmsg(mod));
97 cpu_mdesc_fini(mod, chip);
98 topo_mod_free(mod, chip, sizeof (md_info_t));
102 topo_mod_dprintf(mod, "chip enumerator inited\n");
108 _topo_fini(topo_mod_t *mod)
112 chip = (md_info_t *)topo_mod_getspecific(mod);
114 cpu_mdesc_fini(mod, chip);
116 topo_mod_free(mod, chip, sizeof (md_info_t));
118 topo_mod_unregister(mod);
122 chip_tnode_create(topo_mod_t *mod, tnode_t *parent,
132 if (topo_mod_nvalloc(mod, &auth, NV_UNIQUE_NAME) == 0) {
137 topo_mod_strfree(mod, prod);
143 topo_mod_strfree(mod, psn);
149 topo_mod_strfree(mod, server);
155 topo_mod_strfree(mod, csn);
160 fmri = topo_mod_hcfmri(mod, parent, FM_HC_SCHEME_VERSION, name, i,
164 topo_mod_dprintf(mod,
166 name, topo_mod_errmsg(mod));
170 ntn = topo_node_bind(mod, parent, name, i, fmri);
172 topo_mod_dprintf(mod,
176 topo_strerror(topo_mod_errno(mod)));
199 if (topo_method_register(mod, ntn, pi_cpu_methods) < 0)
200 topo_mod_dprintf(mod, "Unsable to register retire methods "
203 name, i, topo_mod_errmsg(mod));
209 cpu_fmri_create(topo_mod_t *mod, uint32_t cpuid, char *serial, uint8_t cpumask)
214 if (topo_mod_nvalloc(mod, &fmri, NV_UNIQUE_NAME) != 0)
224 (void) topo_mod_seterrno(mod, EMOD_FMRI_NVL);
233 cpu_create(topo_mod_t *mod, tnode_t *rnode, const char *name, md_info_t *chip,
247 topo_mod_dprintf(mod, "enumerating cpus\n");
261 topo_mod_dprintf(mod, "Invalid cpu range(%d,%d)\n", min, max);
264 if (topo_node_range_create(mod, rnode, name, 0, max+1) < 0) {
265 topo_mod_dprintf(mod, "failed to create cpu range[0,%d]: %s\n",
266 max, topo_mod_errmsg(mod));
284 cnode = chip_tnode_create(mod, rnode, name,
287 topo_mod_dprintf(mod,
289 pid, topo_mod_errmsg(mod));
294 if ((asru = cpu_fmri_create(mod, pid, sbuf, 0)) != NULL) {
303 (void) topo_mod_seterrno(mod, EMOD_PARTIAL_ENUM);
309 dimm_instantiate(tnode_t *parent, const char *name, topo_mod_t *mod)
312 topo_mod_dprintf(mod,
317 topo_mod_dprintf(mod,
319 if (topo_mod_enumerate(mod,
321 return (topo_mod_seterrno(mod, EMOD_PARTIAL_ENUM));
343 chip_create(topo_mod_t *mod, tnode_t *rnode, const char *name,
355 topo_mod_dprintf(mod, "enumerating cmp chip\n");
357 topo_mod_dprintf(mod, "Invalid chip range(%d,%d)\n", min, max);
361 if (dimm_enum_load(mod) == NULL)
379 topo_mod_dprintf(mod, "node chip[%d], sn=%s\n", i, sbuf);
381 cnode = chip_tnode_create(mod, rnode, name, (topo_instance_t)i,
384 topo_mod_dprintf(mod, "failed to create a chip node: "
385 "%s\n", topo_mod_errmsg(mod));
391 err = cpu_create(mod, cnode, CPU_NODE_NAME, chip,
398 if (dimm_instantiate(cnode, CHIP, mod) < 0) {
399 topo_mod_dprintf(mod, "Enumeration of dimm "
400 "failed %s\n", topo_mod_errmsg(mod));
406 (void) topo_mod_seterrno(mod, EMOD_PARTIAL_ENUM);
413 chip_enum(topo_mod_t *mod, tnode_t *rnode, const char *name,
419 return (chip_create(mod, rnode, name, min, max, chip));