Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/audio/module_adapter/module_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ static struct k_heap *module_adapter_dp_heap_new(const struct comp_ipc_config *c
void *mod_heap_buf = mod_heap_mem + heap_prefix_size;

k_heap_init(mod_heap, mod_heap_buf, heap_size - heap_prefix_size);
#ifdef __ZEPHYR__
mod_heap->heap.init_mem = mod_heap_buf;
mod_heap->heap.init_bytes = heap_size - heap_prefix_size;
#endif

return mod_heap;
}
Expand Down
7 changes: 4 additions & 3 deletions src/ipc/ipc4/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,10 @@ __cold int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect)
sink_get_min_free_space(snk),
audio_buffer_is_shared(&buffer->audio_buffer),
buf_get_id(buffer));
if (!ring_buffer)
goto free_unlocked;
if (!ring_buffer) {
buffer_free(buffer);
return IPC4_OUT_OF_MEMORY;
}

/* data destination module needs to use ring_buffer */
audio_buffer_attach_secondary_buffer(&buffer->audio_buffer, dp_on_source,
Expand Down Expand Up @@ -698,7 +700,6 @@ __cold int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect)
pipeline_disconnect(source, buffer, PPL_CONN_DIR_COMP_TO_BUFFER);
free:
ll_unblock(cross_core_bind, flags);
free_unlocked:
buffer_free(buffer);
return IPC4_INVALID_RESOURCE_STATE;
}
Expand Down
8 changes: 4 additions & 4 deletions zephyr/lib/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static bool is_heap_pointer(const struct k_heap *heap, void *ptr)
POINTER_TO_UINT(sys_cache_cached_ptr_get(heap->heap.init_mem));
uintptr_t heap_end = heap_start + heap->heap.init_bytes;

if (!is_cached(ptr))
if (!sys_cache_is_ptr_cached(ptr))
ptr = (__sparse_force void *)sys_cache_cached_ptr_get(ptr);

return ((POINTER_TO_UINT(ptr) >= heap_start) &&
Expand All @@ -182,7 +182,7 @@ static bool is_shared_buffer_heap_pointer(void *ptr)
uintptr_t shd_heap_start = POINTER_TO_UINT(shared_heapmem);
uintptr_t shd_heap_end = POINTER_TO_UINT(shared_heapmem + SHARED_BUFFER_HEAP_MEM_SIZE);

if (is_cached(ptr))
if (sys_cache_is_ptr_cached(ptr))
ptr = sys_cache_uncached_ptr_get((__sparse_force void __sparse_cache *)ptr);

return (POINTER_TO_UINT(ptr) >= shd_heap_start) && (POINTER_TO_UINT(ptr) < shd_heap_end);
Expand Down Expand Up @@ -341,7 +341,7 @@ static bool is_virtual_heap_pointer(void *ptr)
POINTER_TO_UINT(sys_cache_cached_ptr_get(&_unused_ram_start_marker));
uintptr_t virtual_heap_end = CONFIG_KERNEL_VM_BASE + CONFIG_KERNEL_VM_SIZE;

if (!is_cached(ptr))
if (!sys_cache_is_ptr_cached(ptr))
ptr = (__sparse_force void *)sys_cache_cached_ptr_get(ptr);

return ((POINTER_TO_UINT(ptr) >= virtual_heap_start) &&
Expand Down Expand Up @@ -463,7 +463,7 @@ static void heap_free(struct k_heap *h, void *mem)
#ifdef CONFIG_SOF_ZEPHYR_HEAP_CACHED
void *mem_uncached;

if (is_cached(mem)) {
if (sys_cache_is_ptr_cached(mem)) {
mem_uncached = sys_cache_uncached_ptr_get((__sparse_force void __sparse_cache *)mem);
sys_cache_data_flush_and_invd_range(mem,
sys_heap_usable_size(&h->heap, mem_uncached));
Expand Down