Lines Matching refs:va_block
401 struct hl_vm_va_block *va_block, *tmp; in clear_va_list_locked() local
403 list_for_each_entry_safe(va_block, tmp, va_list, node) { in clear_va_list_locked()
404 list_del(&va_block->node); in clear_va_list_locked()
405 kfree(va_block); in clear_va_list_locked()
423 struct hl_vm_va_block *va_block; in print_va_list_locked() local
427 list_for_each_entry(va_block, va_list, node) in print_va_list_locked()
430 va_block->start, va_block->end, va_block->size); in print_va_list_locked()
447 struct list_head *va_list, struct hl_vm_va_block *va_block) in merge_va_blocks_locked() argument
451 prev = list_prev_entry(va_block, node); in merge_va_blocks_locked()
452 if (&prev->node != va_list && prev->end + 1 == va_block->start) { in merge_va_blocks_locked()
453 prev->end = va_block->end; in merge_va_blocks_locked()
455 list_del(&va_block->node); in merge_va_blocks_locked()
456 kfree(va_block); in merge_va_blocks_locked()
457 va_block = prev; in merge_va_blocks_locked()
460 next = list_next_entry(va_block, node); in merge_va_blocks_locked()
461 if (&next->node != va_list && va_block->end + 1 == next->start) { in merge_va_blocks_locked()
462 next->start = va_block->start; in merge_va_blocks_locked()
464 list_del(&va_block->node); in merge_va_blocks_locked()
465 kfree(va_block); in merge_va_blocks_locked()
485 struct hl_vm_va_block *va_block, *res = NULL; in add_va_block_locked() local
490 list_for_each_entry(va_block, va_list, node) { in add_va_block_locked()
492 if (hl_mem_area_crosses_range(start, size, va_block->start, in add_va_block_locked()
493 va_block->end)) { in add_va_block_locked()
496 va_block->start, va_block->end); in add_va_block_locked()
500 if (va_block->end < start) in add_va_block_locked()
501 res = va_block; in add_va_block_locked()
504 va_block = kmalloc(sizeof(*va_block), GFP_KERNEL); in add_va_block_locked()
505 if (!va_block) in add_va_block_locked()
508 va_block->start = start; in add_va_block_locked()
509 va_block->end = end; in add_va_block_locked()
510 va_block->size = size; in add_va_block_locked()
513 list_add(&va_block->node, va_list); in add_va_block_locked()
515 list_add(&va_block->node, &res->node); in add_va_block_locked()
517 merge_va_blocks_locked(hdev, va_list, va_block); in add_va_block_locked()
599 struct hl_vm_va_block *va_block, *new_va_block = NULL; in get_va_block() local
646 list_for_each_entry(va_block, &va_range->list, node) { in get_va_block()
648 valid_start = va_block->start; in get_va_block()
653 if (valid_start > va_block->end) in get_va_block()
657 valid_size = va_block->end - valid_start + 1; in get_va_block()
673 new_va_block = va_block; in get_va_block()
679 (hint_addr + size) <= va_block->end) { in get_va_block()
680 new_va_block = va_block; in get_va_block()