Lines Matching defs:map

763 	e = m->map[vl & m->mask];
800 struct sdma_rht_map_elem *map[HFI1_MAX_VLS_SUPPORTED];
846 if (rht_node && rht_node->map[vl]) {
847 struct sdma_rht_map_elem *map = rht_node->map[vl];
849 sde = map->sde[selector & map->mask];
860 static void sdma_populate_sde_map(struct sdma_rht_map_elem *map)
864 for (i = 0; i < roundup_pow_of_two(map->ctr ? : 1) - map->ctr; i++)
865 map->sde[map->ctr + i] = map->sde[i];
868 static void sdma_cleanup_sde_map(struct sdma_rht_map_elem *map,
874 for (i = 0; i < map->ctr; i++) {
875 if (map->sde[i] == sde) {
876 memmove(&map->sde[i], &map->sde[i + 1],
877 (map->ctr - i - 1) * sizeof(map->sde[0]));
878 map->ctr--;
879 pow = roundup_pow_of_two(map->ctr ? : 1);
880 map->mask = pow - 1;
881 sdma_populate_sde_map(map);
902 if (unlikely(vl < 0 || vl >= ARRAY_SIZE(rht_node->map)))
945 rht_node->map[vl] = kzalloc(sz, GFP_KERNEL);
946 if (!rht_node->map[vl]) {
952 rht_node->map[vl]->mask = 0;
953 rht_node->map[vl]->ctr = 1;
954 rht_node->map[vl]->sde[0] = sde;
960 kfree(rht_node->map[vl]);
971 if (!rht_node->map[vl])
972 rht_node->map[vl] = kzalloc(sz, GFP_KERNEL);
974 if (!rht_node->map[vl]) {
979 rht_node->map[vl]->ctr++;
980 ctr = rht_node->map[vl]->ctr;
981 rht_node->map[vl]->sde[ctr - 1] = sde;
983 rht_node->map[vl]->mask = pow - 1;
985 /* Populate the sde map table */
986 sdma_populate_sde_map(rht_node->map[vl]);
1007 if (rht_node->map[i])
1008 sdma_cleanup_sde_map(rht_node->map[i],
1013 if (!rht_node->map[i])
1016 if (rht_node->map[i]->ctr) {
1029 kfree(rht_node->map[i]);
1062 kfree(rht_node->map[i]);
1089 if (!rht_node->map[i] || !rht_node->map[i]->ctr)
1094 for (j = 0; j < rht_node->map[i]->ctr; j++) {
1095 if (!rht_node->map[i]->sde[j])
1102 rht_node->map[i]->sde[j]->this_idx);
1111 * Free the indicated map struct
1118 kfree(m->map[i]);
1155 * If an error occurs the map change is not done and the mapping is
1180 /* build new map */
1191 /* initialize back-map */
1202 newmap->map[i] = kzalloc(
1206 if (!newmap->map[i])
1208 newmap->map[i]->mask = (1 << ilog2(sz)) - 1;
1211 newmap->map[i]->sde[j] =
1217 /* assign back-map */
1222 newmap->map[i] = newmap->map[i % num_vls];
1226 /* newmap in hand, save old map */
1235 /* success, free any old map after grace period */
3116 /* dma map the coalesce buffer */