Skip to content

Commit 8a5dbca

Browse files
committed
schedule: dp: make compatible with userspace LL
DP scheduler operations, instance data and DP module memory have to be accessible to the userspace LL scheduler. Allocate dynamic data on the userspace heap and place static data in the userspace accessible ELF section. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 92f0ef0 commit 8a5dbca

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/audio/module_adapter/module_adapter.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ static struct processing_module *module_adapter_mem_alloc(const struct comp_driv
167167
comp_cl_err(drv, "Failed to allocate DP module heap / vregion");
168168
return NULL;
169169
}
170+
#ifdef CONFIG_SOF_USERSPACE_LL
171+
mod_heap = sof_sys_user_heap_get();
172+
#else
170173
mod_heap = NULL;
174+
#endif
171175
} else {
172176
#ifdef CONFIG_SOF_USERSPACE_LL
173177
mod_heap = sof_sys_user_heap_get();

src/schedule/zephyr_dp_schedule.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static int scheduler_dp_task_shedule(void *data, struct task *task, uint64_t sta
348348
return 0;
349349
}
350350

351-
static struct scheduler_ops schedule_dp_ops = {
351+
APP_SYSUSER_DATA static struct scheduler_ops schedule_dp_ops = {
352352
.schedule_task = scheduler_dp_task_shedule,
353353
#if CONFIG_SOF_USERSPACE_APPLICATION
354354
.schedule_task_cancel = scheduler_dp_task_cancel,
@@ -361,8 +361,9 @@ static struct scheduler_ops schedule_dp_ops = {
361361
/* Runs on each core */
362362
int scheduler_dp_init(void)
363363
{
364-
struct scheduler_dp_data *dp_sch = rzalloc(SOF_MEM_FLAG_KERNEL,
365-
sizeof(struct scheduler_dp_data));
364+
struct scheduler_dp_data *dp_sch = sof_heap_alloc(sof_sys_user_heap_get(),
365+
SOF_MEM_FLAG_KERNEL,
366+
sizeof(struct scheduler_dp_data), 0);
366367
if (!dp_sch)
367368
return -ENOMEM;
368369

0 commit comments

Comments
 (0)