Lines Matching defs:dam
101 damap_free(struct dam *dam, void **kdamda, int kdamda_n)
107 if (dam) {
109 ss = (struct i_ddi_soft_state *)dam->dam_da;
124 /* free dam_active/stable/report_set embedded in dam */
125 bitset_free(&dam->dam_report_set, 1);
126 bitset_free(&dam->dam_stable_set, 1);
127 bitset_free(&dam->dam_active_set, 1);
130 local_strfree(dam->dam_name);
132 /* free dam */
133 mdb_free(dam, sizeof (*dam));
141 * The dam implementation uses a number of different abstractions. Given a
142 * pointer to a damap_t, this function make an mdb instantiation of the dam -
143 * many, but not all, of the different abstractions used in the dam
148 struct dam *
152 struct dam kdam;
159 struct dam *dam = NULL;
166 /* read kernel: dam */
168 mdb_warn("couldn't read dam 0x%p", damaddr);
172 /* read kernel: dam->dam_name */
175 /* read kernel: dam->dam_da (softstate) */
177 mdb_warn("couldn't read dam dam_da 0x%p",
182 /* read kernel ((struct i_ddi_soft_state *)dam->dam_da)->array */
186 mdb_warn("couldn't read dam dam_da array 0x%p",
194 * Structure copy kdam to dam, then clear out pointers in dam (some
197 dam = mdb_zalloc(sizeof (*dam), UM_SLEEP);
198 *dam = kdam;
199 dam->dam_name = NULL;
201 dam->dam_active_set.bs_set = NULL;
202 dam->dam_stable_set.bs_set = NULL;
203 dam->dam_report_set.bs_set = NULL;
205 dam->dam_da = NULL;
209 dam->dam_name = local_strdup(kstring);
211 /* fill in dam_active/stable/report_set embedded in the dam */
212 bs = bitset_get(damaddr + (offsetof(struct dam, dam_active_set)));
214 dam->dam_active_set = *bs;
217 bs = bitset_get(damaddr + (offsetof(struct dam, dam_stable_set)));
219 dam->dam_stable_set = *bs;
222 bs = bitset_get(damaddr + (offsetof(struct dam, dam_report_set)));
224 dam->dam_report_set = *bs;
233 dam->dam_da = ss;
239 mdb_warn("couldn't read dam dam_da %d 0x%p", i,
254 /* return pointer to mdb instantiation of the dam */
255 return (dam);
257 err: damap_free(dam, kssarray, array_sz / sizeof (void *));
265 damap_print(struct dam *dam, void **kdamda, int kdamda_n)
271 mdb_printf("%s:\n", dam->dam_name);
273 ss = (struct i_ddi_soft_state *)dam->dam_da;
291 if (BT_TEST(dam->dam_active_set.bs_set, i))
295 if (BT_TEST(dam->dam_stable_set.bs_set, i))
299 if (BT_TEST(dam->dam_report_set.bs_set, i))
316 struct dam *dam;
324 dam = damap_get(addr, &kdamda, &kdamda_n);
325 if (dam == NULL)
328 damap_print(dam, kdamda, kdamda_n);
329 damap_free(dam, kdamda, kdamda_n);