Lines Matching refs:region_index
127 unsigned long *region_index, unsigned *bit) in switch_get_position() argument
130 *region_index = region_nr >> sctx->region_entries_per_slot_bits; in switch_get_position()
133 *region_index = region_nr / sctx->region_entries_per_slot; in switch_get_position()
142 unsigned long region_index; in switch_region_table_read() local
145 switch_get_position(sctx, region_nr, ®ion_index, &bit); in switch_region_table_read()
147 return (READ_ONCE(sctx->region_table[region_index]) >> bit) & in switch_region_table_read()
177 unsigned long region_index; in switch_region_table_write() local
181 switch_get_position(sctx, region_nr, ®ion_index, &bit); in switch_region_table_write()
183 pte = sctx->region_table[region_index]; in switch_region_table_write()
186 sctx->region_table[region_index] = pte; in switch_region_table_write()
377 unsigned long region_index = 0; in process_set_region_mappings() local
407 if (unlikely(!cycle_length) || unlikely(cycle_length - 1 > region_index)) { in process_set_region_mappings()
409 cycle_length - 1, region_index); in process_set_region_mappings()
412 if (unlikely(region_index + num_write < region_index) || in process_set_region_mappings()
413 unlikely(region_index + num_write >= sctx->nr_regions)) { in process_set_region_mappings()
415 region_index, num_write, sctx->nr_regions); in process_set_region_mappings()
420 region_index++; in process_set_region_mappings()
421 path_nr = switch_region_table_read(sctx, region_index - cycle_length); in process_set_region_mappings()
422 switch_region_table_write(sctx, region_index, path_nr); in process_set_region_mappings()
429 region_index++; in process_set_region_mappings()
431 region_index = parse_hex(&string); in process_set_region_mappings()
449 if (unlikely(region_index >= sctx->nr_regions)) { in process_set_region_mappings()
450 DMWARN("invalid set_region_mappings region number: %lu >= %lu", region_index, sctx->nr_regions); in process_set_region_mappings()
458 switch_region_table_write(sctx, region_index, path_nr); in process_set_region_mappings()