Lines Matching defs:table

113 /* Lookup table entry for matching IO devices to RCM resource usage */
115 int index; /* index into the table array */
125 lookup_entry_t *table;
132 lookup_table_t *table;
178 static lookup_entry_t *lookup(lookup_table_t *table, const char *);
274 * passes through the apd table skip over the first
991 * Assume the ecache_info table has the right e-cache size for
1201 /* Initialize empty device lookup table */
1204 devicetable.table = NULL;
1229 di_arg.table = &devicetable;
1232 /* Use libdevinfo treewalk to build device lookup table */
1256 /* Sort the device table by name (proper order for lookups) */
1257 qsort(devicetable.table, devicetable.n_entries, sizeof (lookup_entry_t),
1260 /* Perform mappings of RCM usage segments to device table entries */
1280 /* Re-sort the device table by index number (original treewalk order) */
1281 qsort(devicetable.table, devicetable.n_entries, sizeof (lookup_entry_t),
1285 * Use the mapped usage and the device table to construct ri_dev_t's.
1286 * Construct one for each set of entries in the device table with
1294 node = devicetable.table[i].node;
1300 (devicetable.table[i + set_size].node == node)) {
1301 n_usage += devicetable.table[i + set_size].n_usage;
1321 if (mk_drv_inst(node, drv_inst, devicetable.table[i].name)) {
1334 for (k = 0; k < devicetable.table[j].n_usage; k++) {
1337 (char *)devicetable.table[j].usage[k].rsrc,
1338 (char *)devicetable.table[j].usage[k].info);
1350 devicetable.table[j].usage[k].rsrc,
1351 devicetable.table[j].usage[k].info) != 0)) {
1430 * is stored in a lookup table along with a reference to the
1433 * stored in the same lookup table along with a reference to
1467 /* Add an entry to the lookup table for this physical device */
1468 if (add_lookup_entry(di_arg->table, di_arg->pathbuf, node)) {
1524 if (add_lookup_entry(di_arg->table, pathbuf, node)) {
1562 if (add_lookup_entry(di_arg->table, linkpath, di_arg->node)) {
1914 * The lookup table is a simple array that is grown in chunks
1930 add_lookup_entry(lookup_table_t *table, const char *name, di_node_t node)
1936 /* Grow the lookup table by USAGE_ALLOC_SIZE slots if necessary */
1937 if (table->n_entries == table->n_slots) {
1938 size = (table->n_slots + USAGE_ALLOC_SIZE) *
1940 new_table = (lookup_entry_t *)realloc(table->table, size);
1947 table->table = new_table;
1948 table->n_slots += USAGE_ALLOC_SIZE;
1951 dprintf((stderr, "add_lookup_entry[%d]:%s\n", table->n_entries, name));
1954 if ((table->table[table->n_entries].name = strdup(name)) == NULL) {
1960 table->table[table->n_entries].index = table->n_entries;
1961 table->table[table->n_entries].node = node;
1962 table->table[table->n_entries].n_usage = 0;
1963 table->table[table->n_entries].usage = NULL;
1964 table->n_entries += 1;
1970 * lookup table entry names are full pathname strings, all start with /
1999 * Given a RCM resource name, find the matching entry in the IO device table
2002 lookup(lookup_table_t *table, const char *rcm_rsrc)
2009 entry = bsearch(&lookup_arg, table->table, table->n_entries,
2021 * Add RCM usage to the given device table entry.
2056 empty_table(lookup_table_t *table)
2060 if (table) {
2061 for (i = 0; i < table->n_entries; i++) {
2062 if (table->table[i].name)
2063 free(table->table[i].name);
2068 if (table->table[i].usage)
2069 free(table->table[i].usage);
2071 if (table->table)
2072 free(table->table);
2073 table->table = NULL;
2074 table->n_entries = 0;
2075 table->n_slots = 0;