Lines Matching refs:mod

109 _topo_init(topo_mod_t *mod)
112 topo_mod_setdebug(mod);
113 topo_mod_dprintf(mod, "initializing chip enumerator\n");
115 if (topo_mod_register(mod, &chip_info, TOPO_VERSION) != 0) {
116 whinge(mod, NULL, "failed to register hc: "
117 "%s\n", topo_mod_errmsg(mod));
118 return (-1); /* mod errno set */
125 _topo_fini(topo_mod_t *mod)
127 topo_mod_unregister(mod);
145 create_node(topo_mod_t *mod, tnode_t *pnode, nvlist_t *auth, char *name,
151 if (mkrsrc(mod, pnode, name, inst, auth, &fmri) != 0) {
152 whinge(mod, NULL, "create_node: mkrsrc failed\n");
156 if (FM_AWARE_SMBIOS(mod)) {
164 serial = chip_serial_smbios_get(mod, phys_cpu_smbid);
165 part = chip_part_smbios_get(mod, phys_cpu_smbid);
166 rev = chip_rev_smbios_get(mod, phys_cpu_smbid);
176 whinge(mod, NULL,
179 topo_mod_strfree(mod, (char *)serial);
180 topo_mod_strfree(mod, (char *)part);
181 topo_mod_strfree(mod, (char *)rev);
184 cnode = topo_node_bind(mod, pnode, name, inst, fmri);
188 whinge(mod, NULL, "create_node: node bind failed"
196 create_strand(topo_mod_t *mod, tnode_t *pnode, nvlist_t *cpu,
209 whinge(mod, NULL, "create_strand: lookup strand_id failed: "
216 whinge(mod, NULL, "create_strand: duplicate tuple found\n");
220 if ((strand = create_node(mod, pnode, auth, STRAND_NODE_NAME,
233 if (FM_AWARE_SMBIOS(mod)) {
238 whinge(mod, NULL,
241 whinge(mod, NULL,
244 serial = topo_mod_strdup(mod, val);
249 whinge(mod, &nerr, "create_strand: "
252 if (FM_AWARE_SMBIOS(mod))
260 whinge(mod, &nerr, "create_strand: lookup cpuid "
263 if ((fmri = cpu_fmri_create(mod, cpuid, serial, 0))
269 whinge(mod, &nerr, "create_strand: "
275 if (topo_method_register(mod, strand, strands_retire_methods) < 0)
276 whinge(mod, &nerr, "create_strand: "
280 nerr -= add_nvlist_longprops(mod, strand, cpu, PGNAME(STRAND), NULL,
284 if (FM_AWARE_SMBIOS(mod)) {
288 whinge(mod, &nerr, "create_strand: "
299 whinge(mod, NULL,
312 whinge(mod, NULL, "create_strand: topo_prop_set_string"
316 topo_mod_strfree(mod, serial);
323 create_core(topo_mod_t *mod, tnode_t *pnode, nvlist_t *cpu,
336 whinge(mod, NULL, "create_core: lookup core_id failed: %s\n",
341 if ((core = create_node(mod, pnode, auth, CORE_NODE_NAME,
354 if (FM_AWARE_SMBIOS(mod)) {
358 whinge(mod, NULL,
362 whinge(mod, NULL, "create_core:"
365 serial = topo_mod_strdup(mod, val);
370 whinge(mod, &nerr, "create_core: "
373 if (FM_AWARE_SMBIOS(mod))
380 if (topo_method_register(mod, core, strands_retire_methods) < 0)
381 whinge(mod, &nerr, "create_core: "
385 nerr -= add_nvlist_longprops(mod, core, cpu, PGNAME(CORE), NULL,
388 if (topo_node_range_create(mod, core, STRAND_NODE_NAME,
400 whinge(mod, &nerr, "create_core: lookup cpuid "
403 if ((fmri = cpu_fmri_create(mod, cpuid, serial, 0))
408 whinge(mod, &nerr, "create_core: "
414 if (FM_AWARE_SMBIOS(mod)) {
418 whinge(mod, &nerr, "create_core: "
429 whinge(mod, NULL,
442 whinge(mod, NULL, "create_core: topo_prop_set_string"
446 topo_mod_strfree(mod, serial);
449 err = create_strand(mod, core, cpu, auth, chip_smbiosid);
455 create_chip(topo_mod_t *mod, tnode_t *pnode, topo_instance_t min,
482 whinge(mod, NULL, "create_chip: lookup failed: %s\n",
490 if (FM_AWARE_SMBIOS(mod)) {
493 whinge(mod, NULL,
505 topo_mod_setspecific(mod, NULL);
510 if ((chip = create_node(mod, pnode, auth, CHIP_NODE_NAME,
517 if (!FM_AWARE_SMBIOS(mod)) {
518 if (topo_method_register(mod, chip, chip_methods) < 0)
519 whinge(mod, &nerr, "create_chip: "
524 nerr -= add_nvlist_strprop(mod, chip, cpu, PGNAME(CHIP),
526 nerr -= add_nvlist_longprops(mod, chip, cpu, PGNAME(CHIP),
529 if (FM_AWARE_SMBIOS(mod)) {
536 fru = chip_fru_smbios_get(mod, smbios_id);
541 whinge(mod, &nerr, "create_chip: "
547 label = (char *)chip_label_smbios_get(mod,
552 whinge(mod, NULL, "create_chip: "
566 whinge(mod, NULL,
583 whinge(mod, NULL,
591 whinge(mod, NULL, "create_chip: "
594 topo_mod_strfree(mod, label);
598 whinge(mod, &nerr, "create_chip: "
606 if (topo_method_register(mod, chip, strands_retire_methods) < 0)
607 whinge(mod, &nerr, "create_chip: "
610 if (topo_node_range_create(mod, chip, CORE_NODE_NAME, 0, 255))
614 if (topo_node_range_create(mod, chip, MCT_NODE_NAME,
622 if (FM_AWARE_SMBIOS(mod)) {
638 status = chip_status_smbios_get(mod, (id_t)smbios_id);
640 whinge(mod, NULL, "create_chip: "
646 err = create_core(mod, chip, cpu, auth, smbios_id);
655 amd_mc_create(mod, smbios_id, chip, MCT_NODE_NAME, auth,
658 onchip_mc_create(mod, smbios_id, chip, MCT_NODE_NAME, auth);
665 create_chips(topo_mod_t *mod, tnode_t *pnode, const char *name,
680 whinge(mod, NULL, "create_chip: fmd_agent_physcpu_info "
688 nerr -= create_chip(mod, pnode, min, max, cpus[i], auth,
697 (void) topo_mod_seterrno(mod, EMOD_PARTIAL_ENUM);
704 chip_enum(topo_mod_t *mod, tnode_t *pnode, const char *name,
740 topo_mod_setspecific(mod, smbios_enabled);
742 if (FM_AWARE_SMBIOS(mod))
743 if (init_chip_smbios(mod) != 0) {
744 whinge(mod, NULL,
756 topo_mod_setspecific(mod, NULL);
759 auth = topo_mod_auth(mod, pnode);
763 rv = create_chips(mod, pnode, name, min, max, NULL, auth,
767 (void) mc_offchip_create(mod, pnode, "memory-controller", auth);