Lines Matching refs:block

117 	struct sst_mem_block *block, *tmp;  in block_list_remove()  local
121 list_for_each_entry(block, block_list, module_list) { in block_list_remove()
123 if (block->ops && block->ops->disable) { in block_list_remove()
124 err = block->ops->disable(block); in block_list_remove()
128 block->type, block->index); in block_list_remove()
133 list_for_each_entry_safe(block, tmp, block_list, module_list) { in block_list_remove()
134 list_del(&block->module_list); in block_list_remove()
135 list_move(&block->list, &dsp->free_block_list); in block_list_remove()
137 block->type, block->index, block->offset); in block_list_remove()
145 struct sst_mem_block *block; in block_list_prepare() local
149 list_for_each_entry(block, block_list, module_list) { in block_list_prepare()
151 if (block->ops && block->ops->enable && !block->users) { in block_list_prepare()
152 ret = block->ops->enable(block); in block_list_prepare()
156 block->type, block->index); in block_list_prepare()
164 list_for_each_entry(block, block_list, module_list) { in block_list_prepare()
165 if (block->ops && block->ops->disable) in block_list_prepare()
166 block->ops->disable(block); in block_list_prepare()
558 struct sst_mem_block *block; in find_block() local
560 list_for_each_entry(block, &dsp->free_block_list, list) { in find_block()
561 if (block->type == ba->type && block->offset == ba->offset) in find_block()
562 return block; in find_block()
573 struct sst_mem_block *block; in block_alloc_contiguous() local
579 block = find_block(dsp, ba); in block_alloc_contiguous()
580 if (!block) { in block_alloc_contiguous()
588 list_move_tail(&block->list, &tmp); in block_alloc_contiguous()
589 ba->offset += block->size; in block_alloc_contiguous()
590 ba->size -= block->size; in block_alloc_contiguous()
595 list_for_each_entry(block, &tmp, list) { in block_alloc_contiguous()
597 if (block->offset < block_start) in block_alloc_contiguous()
598 block_start = block->offset; in block_alloc_contiguous()
600 list_add(&block->module_list, block_list); in block_alloc_contiguous()
603 block->type, block->index, block->offset); in block_alloc_contiguous()
614 struct sst_mem_block *block, *tmp; in block_alloc() local
621 list_for_each_entry_safe(block, tmp, &dsp->free_block_list, list) { in block_alloc()
624 if (block->type != ba->type) in block_alloc()
627 if (ba->size > block->size) in block_alloc()
630 ba->offset = block->offset; in block_alloc()
631 block->bytes_used = ba->size % block->size; in block_alloc()
632 list_add(&block->module_list, block_list); in block_alloc()
633 list_move(&block->list, &dsp->used_block_list); in block_alloc()
635 block->type, block->index, block->offset); in block_alloc()
640 list_for_each_entry_safe(block, tmp, &dsp->free_block_list, list) { in block_alloc()
643 if (block->type != ba->type) in block_alloc()
647 if (ba->size > block->size) { in block_alloc()
650 ba->offset = block->offset; in block_alloc()
703 struct sst_mem_block *block, *tmp; in block_alloc_fixed() local
713 list_for_each_entry_safe(block, tmp, block_list, module_list) { in block_alloc_fixed()
716 if (block->type != ba->type) in block_alloc_fixed()
719 block_end = block->offset + block->size; in block_alloc_fixed()
722 if (ba->offset >= block->offset && end <= block_end) in block_alloc_fixed()
726 if (ba->offset >= block->offset && ba->offset < block_end) { in block_alloc_fixed()
741 list_for_each_entry_safe(block, tmp, &dsp->free_block_list, list) { in block_alloc_fixed()
742 block_end = block->offset + block->size; in block_alloc_fixed()
745 if (block->type != ba->type) in block_alloc_fixed()
749 if (ba->offset >= block->offset && end <= block_end) { in block_alloc_fixed()
752 list_move(&block->list, &dsp->used_block_list); in block_alloc_fixed()
753 list_add(&block->module_list, block_list); in block_alloc_fixed()
755 block->type, block->index, block->offset); in block_alloc_fixed()
760 if (ba->offset >= block->offset && ba->offset < block_end) { in block_alloc_fixed()
763 list_move(&block->list, &dsp->used_block_list); in block_alloc_fixed()
764 list_add(&block->module_list, block_list); in block_alloc_fixed()
1020 struct sst_mem_block *block; in sst_mem_block_register() local
1022 block = kzalloc(sizeof(*block), GFP_KERNEL); in sst_mem_block_register()
1023 if (block == NULL) in sst_mem_block_register()
1026 block->offset = offset; in sst_mem_block_register()
1027 block->size = size; in sst_mem_block_register()
1028 block->index = index; in sst_mem_block_register()
1029 block->type = type; in sst_mem_block_register()
1030 block->dsp = dsp; in sst_mem_block_register()
1031 block->private = private; in sst_mem_block_register()
1032 block->ops = ops; in sst_mem_block_register()
1035 list_add(&block->list, &dsp->free_block_list); in sst_mem_block_register()
1038 return block; in sst_mem_block_register()
1045 struct sst_mem_block *block, *tmp; in sst_mem_block_unregister_all() local
1050 list_for_each_entry_safe(block, tmp, &dsp->used_block_list, list) { in sst_mem_block_unregister_all()
1051 list_del(&block->list); in sst_mem_block_unregister_all()
1052 kfree(block); in sst_mem_block_unregister_all()
1056 list_for_each_entry_safe(block, tmp, &dsp->free_block_list, list) { in sst_mem_block_unregister_all()
1057 list_del(&block->list); in sst_mem_block_unregister_all()
1058 kfree(block); in sst_mem_block_unregister_all()