void tdo_scheme::exit_partition_stack() { if (the_row_scheme) { FREE_int(the_row_scheme); the_row_scheme = NULL; } if (the_col_scheme) { FREE_int(the_col_scheme); the_col_scheme = NULL; } if (the_extra_row_scheme) { FREE_int(the_extra_row_scheme); the_extra_row_scheme = NULL; } if (the_extra_col_scheme) { FREE_int(the_extra_col_scheme); the_extra_col_scheme = NULL; } free_partition(ROW); free_partition(COL); //if (extra_row_level >= 0) free_partition(EXTRA_ROW); //if (extra_col_level >= 0) free_partition(EXTRA_COL); free_partition(LAMBDA); }
tdo_scheme::~tdo_scheme() { INT i; if (part) { FREE_int(part); part = NULL; } if (entries) { FREE_int(entries); entries = NULL; } for (i = 0; i < NUMBER_OF_SCHEMES; i++) { free_partition(i); } if (the_row_scheme) { FREE_int(the_row_scheme); the_row_scheme = NULL; } if (the_col_scheme) { FREE_int(the_col_scheme); the_col_scheme = NULL; } if (the_extra_row_scheme) { FREE_int(the_extra_row_scheme); the_extra_row_scheme = NULL; } if (the_extra_col_scheme) { FREE_int(the_extra_col_scheme); the_extra_col_scheme = NULL; } if (the_row_scheme_cur) { FREE_INT(the_row_scheme_cur); the_row_scheme_cur = NULL; } if (the_col_scheme_cur) { FREE_INT(the_col_scheme_cur); the_col_scheme_cur = NULL; } if (the_extra_row_scheme_cur) { FREE_INT(the_extra_row_scheme_cur); the_extra_row_scheme_cur = NULL; } if (the_extra_col_scheme_cur) { FREE_INT(the_extra_col_scheme_cur); the_extra_col_scheme_cur = NULL; } if (P) { delete P; P = NULL; } }
void tdo_scheme::get_partition(int h, int l, INT verbose_level) { INT f_v = (verbose_level >= 1); INT f_vv = (verbose_level >= 10); int i; if (f_v) { cout << "tdo_scheme::get_partition h=" << h << " l=" << l << " m=" << m << " n=" << n << endl; } if (l < 0) { cout << "tdo_scheme::get_partition l is negative" << endl; exit(1); } free_partition(h); row_classes[h] = NEW_INT(l); col_classes[h] = NEW_INT(l); row_class_index[h] = NEW_INT(l); col_class_index[h] = NEW_INT(l); row_classes_first[h] = NEW_INT(l); row_classes_len[h] = NEW_INT(l); col_classes_first[h] = NEW_INT(l); col_classes_len[h] = NEW_INT(l); row_class_no[h] = NEW_INT(m); col_class_no[h] = NEW_INT(n); for (i = 0; i < l; i++) { row_class_index[h][i] = -1; col_class_index[h][i] = -1; } P->get_row_and_col_classes(row_classes[h], nb_row_classes[h], col_classes[h], nb_col_classes[h], verbose_level - 1); for (i = 0; i < nb_row_classes[h]; i++) { row_class_index[h][row_classes[h][i]] = i; if (f_vv) { cout << "row_class_index[h][" << row_classes[h][i] << "] = " << row_class_index[h][row_classes[h][i]] << endl; } } for (i = 0; i < nb_col_classes[h]; i++) { col_class_index[h][col_classes[h][i]] = i; if (f_vv) { cout << "col_class_index[h][" << col_classes[h][i] << "] = " << col_class_index[h][col_classes[h][i]] << endl; } } if (f_vv) { cout << "nb_row_classes[h]=" << nb_row_classes[h] << endl; cout << "nb_col_classes[h]=" << nb_col_classes[h] << endl; } }
/***************************************************************************** *Name : *Description :This function unregisters and destroy all slave ntd objects * :which are attached to the given master ntd object. *Parameter : *Return : *Note : *****************************************************************************/ int del_ntd_partitions(struct amlnand_phydev *master) { struct ntd_info *slave, *next; int ret, err = 0; mutex_lock(&ntd_partitions_mutex); list_for_each_entry_safe(slave, next, &ntd_partitions, list) if ((slave->name != NULL) && (slave->priv == (void *)master)) { ret = del_ntd_device(slave); if (ret < 0) { err = ret; continue; } list_del(&slave->list); free_partition(slave); } mutex_unlock(&ntd_partitions_mutex); return err; }