Skip to content

Commit aa2d776

Browse files
committed
ipc: use application heap for IPC pipeline and component allocations
Replace rfree() calls with sof_heap_free() using the system user heap for IPC component and pipeline objects. In ipc4_create_pipeline(), replace the conditional zephyr_ll_user_heap() with the generic sof_sys_user_heap_get() to unify the allocation path across configurations. Signed-off-by: Kai Vehmanen <[email protected]>
1 parent 279b652 commit aa2d776

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/ipc/ipc-helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ __cold int ipc_comp_free(struct ipc *ipc, uint32_t comp_id)
354354
icd->cd = NULL;
355355

356356
list_item_del(&icd->list);
357-
rfree(icd);
357+
sof_heap_free(sof_sys_user_heap_get(), icd);
358358

359359
return 0;
360360
}

src/ipc/ipc4/helper.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -340,14 +340,10 @@ __cold static int ipc4_create_pipeline(struct ipc4_pipeline_create *pipe_desc,
340340
struct ipc_comp_dev *ipc_pipe;
341341
struct pipeline *pipe;
342342
struct ipc *ipc = ipc_get();
343-
struct k_heap *heap = NULL;
343+
struct k_heap *heap = sof_sys_user_heap_get();
344344

345345
assert_can_be_cold();
346346

347-
#ifdef CONFIG_SOF_USERSPACE_LL
348-
heap = zephyr_ll_user_heap();
349-
#endif
350-
351347
LOG_INF("pipe_desc %x, instance %u", pipe_desc, pipe_desc->primary.r.instance_id);
352348

353349
/* check whether pipeline id is already taken or in use */
@@ -561,7 +557,7 @@ __cold int ipc_pipeline_free(struct ipc *ipc, uint32_t comp_id)
561557

562558
ipc_pipe->pipeline = NULL;
563559
list_item_del(&ipc_pipe->list);
564-
rfree(ipc_pipe);
560+
sof_heap_free(sof_sys_user_heap_get(), ipc_pipe);
565561

566562
return IPC4_SUCCESS;
567563
}
@@ -1122,7 +1118,7 @@ __cold int ipc4_chain_dma_state(struct comp_dev *dev, struct ipc4_chain_dma *cdm
11221118
if (icd->cd != dev)
11231119
continue;
11241120
list_item_del(&icd->list);
1125-
rfree(icd);
1121+
sof_heap_free(sof_sys_user_heap_get(), icd);
11261122
break;
11271123
}
11281124
comp_free(dev);

0 commit comments

Comments
 (0)