Lines Matching refs:count

89 int sys_mem_blocks_alloc_contiguous(sys_mem_blocks_t *mem_block, size_t count,  in sys_mem_blocks_alloc_contiguous()  argument
97 if (count == 0) { in sys_mem_blocks_alloc_contiguous()
103 if (count > mem_block->info.num_blocks) { in sys_mem_blocks_alloc_contiguous()
109 void *ptr = alloc_blocks(mem_block, count); in sys_mem_blocks_alloc_contiguous()
119 ptr, count << mem_block->info.blk_sz_shift); in sys_mem_blocks_alloc_contiguous()
126 int sys_mem_blocks_alloc(sys_mem_blocks_t *mem_block, size_t count, in sys_mem_blocks_alloc() argument
137 if (count == 0) { in sys_mem_blocks_alloc()
142 if (count > mem_block->info.num_blocks) { in sys_mem_blocks_alloc()
148 for (i = 0; i < count; i++) { in sys_mem_blocks_alloc()
165 if (i < count) { in sys_mem_blocks_alloc()
175 size_t count) in sys_mem_blocks_is_region_free() argument
187 __ASSERT_NO_MSG(offset + count <= mem_block->info.num_blocks); in sys_mem_blocks_is_region_free()
189 result = sys_bitarray_is_region_cleared(mem_block->bitmap, count, in sys_mem_blocks_is_region_free()
194 int sys_mem_blocks_get(sys_mem_blocks_t *mem_block, void *in_block, size_t count) in sys_mem_blocks_get() argument
203 if (count == 0) { in sys_mem_blocks_get()
211 if (offset + count > mem_block->info.num_blocks) { in sys_mem_blocks_get()
221 ret = sys_bitarray_test_and_set_region(mem_block->bitmap, count, in sys_mem_blocks_get()
233 mem_block->info.used_blocks += (uint32_t)count; in sys_mem_blocks_get()
244 in_block, count << mem_block->info.blk_sz_shift); in sys_mem_blocks_get()
252 int sys_mem_blocks_free(sys_mem_blocks_t *mem_block, size_t count, in sys_mem_blocks_free() argument
263 if (count == 0) { in sys_mem_blocks_free()
268 if (count > mem_block->info.num_blocks) { in sys_mem_blocks_free()
273 for (i = 0; i < count; i++) { in sys_mem_blocks_free()
298 int sys_mem_blocks_free_contiguous(sys_mem_blocks_t *mem_block, void *block, size_t count) in sys_mem_blocks_free_contiguous() argument
306 if (count == 0) { in sys_mem_blocks_free_contiguous()
311 if (count > mem_block->info.num_blocks) { in sys_mem_blocks_free_contiguous()
316 ret = free_blocks(mem_block, block, count); in sys_mem_blocks_free_contiguous()
323 block, count << mem_block->info.blk_sz_shift); in sys_mem_blocks_free_contiguous()
346 void *cfg, size_t count, in sys_multi_mem_blocks_alloc() argument
356 if (count == 0) { in sys_multi_mem_blocks_alloc()
369 if (count > allocator->info.num_blocks) { in sys_multi_mem_blocks_alloc()
374 ret = sys_mem_blocks_alloc(allocator, count, out_blocks); in sys_multi_mem_blocks_alloc()
385 size_t count, void **in_blocks) in sys_multi_mem_blocks_free() argument
394 if (count == 0) { in sys_multi_mem_blocks_free()
420 ret = sys_mem_blocks_free(allocator, count, in_blocks); in sys_multi_mem_blocks_free()