Lines Matching refs:cpuip

80 	cpu_node_t *cpuip;
89 if ((cpuip = topo_mod_zalloc(mod, sizeof (cpu_node_t))) == NULL)
92 if ((cpuip->cn_kc = kstat_open()) == NULL) {
95 topo_mod_free(mod, cpuip, sizeof (cpu_node_t));
99 cpuip->cn_ncpustats = sysconf(_SC_CPUID_MAX);
100 if ((cpuip->cn_cpustats = topo_mod_zalloc(mod, (
101 cpuip->cn_ncpustats + 1) * sizeof (kstat_t *))) == NULL) {
102 (void) kstat_close(cpuip->cn_kc);
103 topo_mod_free(mod, cpuip, sizeof (cpu_node_t));
110 topo_mod_free(mod, cpuip->cn_cpustats,
111 (cpuip->cn_ncpustats + 1) * sizeof (kstat_t *));
112 (void) kstat_close(cpuip->cn_kc);
113 topo_mod_free(mod, cpuip, sizeof (cpu_node_t));
117 topo_mod_setspecific(mod, (void *)cpuip);
125 cpu_node_t *cpuip;
127 cpuip = topo_mod_getspecific(mod);
129 if (cpuip->cn_cpustats != NULL)
130 topo_mod_free(mod, cpuip->cn_cpustats,
131 (cpuip->cn_ncpustats + 1) * sizeof (kstat_t *));
133 (void) kstat_close(cpuip->cn_kc);
134 topo_mod_free(mod, cpuip, sizeof (cpu_node_t));
140 cpu_kstat_init(cpu_node_t *cpuip, int i)
144 if (cpuip->cn_cpustats[i] == NULL) {
145 if ((ksp = kstat_lookup(cpuip->cn_kc, "cpu_info", i, NULL)) ==
146 NULL || kstat_read(cpuip->cn_kc, ksp, NULL) < 0)
149 cpuip->cn_cpustats[i] = ksp;
151 ksp = cpuip->cn_cpustats[i];
160 topo_instance_t min, topo_instance_t max, cpu_node_t *cpuip)
168 for (i = 0; i <= cpuip->cn_ncpustats; i++) {
170 if ((cpu_id = cpu_kstat_init(cpuip, i)) < 0)
173 if ((ks = kstat_data_lookup(cpuip->cn_cpustats[i],
197 cpu_node_t *cpuip = (cpu_node_t *)arg;
208 cpuip->cn_ncpustats + 1) < 0) {
212 cpuip->cn_ncpustats + 1,
217 return (cpu_create(mod, pnode, name, min, max, cpuip));