Lines Matching refs:block
118 struct sst_mem_block *block, *tmp; in block_list_remove() local
122 list_for_each_entry(block, block_list, module_list) { in block_list_remove()
124 if (block->ops && block->ops->disable) { in block_list_remove()
125 err = block->ops->disable(block); in block_list_remove()
129 block->type, block->index); in block_list_remove()
134 list_for_each_entry_safe(block, tmp, block_list, module_list) { in block_list_remove()
135 list_del(&block->module_list); in block_list_remove()
136 list_move(&block->list, &dsp->free_block_list); in block_list_remove()
138 block->type, block->index, block->offset); in block_list_remove()
146 struct sst_mem_block *block; in block_list_prepare() local
150 list_for_each_entry(block, block_list, module_list) { in block_list_prepare()
152 if (block->ops && block->ops->enable && !block->users) { in block_list_prepare()
153 ret = block->ops->enable(block); in block_list_prepare()
157 block->type, block->index); in block_list_prepare()
165 list_for_each_entry(block, block_list, module_list) { in block_list_prepare()
166 if (block->ops && block->ops->disable) in block_list_prepare()
167 block->ops->disable(block); in block_list_prepare()
564 struct sst_mem_block *block; in find_block() local
566 list_for_each_entry(block, &dsp->free_block_list, list) { in find_block()
567 if (block->type == ba->type && block->offset == ba->offset) in find_block()
568 return block; in find_block()
579 struct sst_mem_block *block; in block_alloc_contiguous() local
585 block = find_block(dsp, ba); in block_alloc_contiguous()
586 if (!block) { in block_alloc_contiguous()
594 list_move_tail(&block->list, &tmp); in block_alloc_contiguous()
595 ba->offset += block->size; in block_alloc_contiguous()
596 ba->size -= block->size; in block_alloc_contiguous()
601 list_for_each_entry(block, &tmp, list) { in block_alloc_contiguous()
603 if (block->offset < block_start) in block_alloc_contiguous()
604 block_start = block->offset; in block_alloc_contiguous()
606 list_add(&block->module_list, block_list); in block_alloc_contiguous()
609 block->type, block->index, block->offset); in block_alloc_contiguous()
620 struct sst_mem_block *block, *tmp; in block_alloc() local
627 list_for_each_entry_safe(block, tmp, &dsp->free_block_list, list) { in block_alloc()
630 if (block->type != ba->type) in block_alloc()
633 if (ba->size > block->size) in block_alloc()
636 ba->offset = block->offset; in block_alloc()
637 block->bytes_used = ba->size % block->size; in block_alloc()
638 list_add(&block->module_list, block_list); in block_alloc()
639 list_move(&block->list, &dsp->used_block_list); in block_alloc()
641 block->type, block->index, block->offset); in block_alloc()
646 list_for_each_entry_safe(block, tmp, &dsp->free_block_list, list) { in block_alloc()
649 if (block->type != ba->type) in block_alloc()
653 if (ba->size > block->size) { in block_alloc()
656 ba->offset = block->offset; in block_alloc()
709 struct sst_mem_block *block, *tmp; in block_alloc_fixed() local
719 list_for_each_entry_safe(block, tmp, block_list, module_list) { in block_alloc_fixed()
722 if (block->type != ba->type) in block_alloc_fixed()
725 block_end = block->offset + block->size; in block_alloc_fixed()
728 if (ba->offset >= block->offset && end <= block_end) in block_alloc_fixed()
732 if (ba->offset >= block->offset && ba->offset < block_end) { in block_alloc_fixed()
747 list_for_each_entry_safe(block, tmp, &dsp->free_block_list, list) { in block_alloc_fixed()
748 block_end = block->offset + block->size; in block_alloc_fixed()
751 if (block->type != ba->type) in block_alloc_fixed()
755 if (ba->offset >= block->offset && end <= block_end) { in block_alloc_fixed()
758 list_move(&block->list, &dsp->used_block_list); in block_alloc_fixed()
759 list_add(&block->module_list, block_list); in block_alloc_fixed()
761 block->type, block->index, block->offset); in block_alloc_fixed()
766 if (ba->offset >= block->offset && ba->offset < block_end) { in block_alloc_fixed()
769 list_move(&block->list, &dsp->used_block_list); in block_alloc_fixed()
770 list_add(&block->module_list, block_list); in block_alloc_fixed()
1026 struct sst_mem_block *block; in sst_mem_block_register() local
1028 block = kzalloc(sizeof(*block), GFP_KERNEL); in sst_mem_block_register()
1029 if (block == NULL) in sst_mem_block_register()
1032 block->offset = offset; in sst_mem_block_register()
1033 block->size = size; in sst_mem_block_register()
1034 block->index = index; in sst_mem_block_register()
1035 block->type = type; in sst_mem_block_register()
1036 block->dsp = dsp; in sst_mem_block_register()
1037 block->private = private; in sst_mem_block_register()
1038 block->ops = ops; in sst_mem_block_register()
1041 list_add(&block->list, &dsp->free_block_list); in sst_mem_block_register()
1044 return block; in sst_mem_block_register()
1051 struct sst_mem_block *block, *tmp; in sst_mem_block_unregister_all() local
1056 list_for_each_entry_safe(block, tmp, &dsp->used_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()
1062 list_for_each_entry_safe(block, tmp, &dsp->free_block_list, list) { in sst_mem_block_unregister_all()
1063 list_del(&block->list); in sst_mem_block_unregister_all()
1064 kfree(block); in sst_mem_block_unregister_all()