Skip to content

Commit 1d380bb

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 adc8af6 commit 1d380bb

2 files changed

Lines changed: 7 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
@@ -160,7 +160,11 @@ static struct processing_module *module_adapter_mem_alloc(const struct comp_driv
160160
comp_cl_err(drv, "Failed to allocate DP module heap / vregion");
161161
return NULL;
162162
}
163+
#ifdef CONFIG_SOF_USERSPACE_LL
164+
mod_heap = sof_sys_user_heap_get();
165+
#else
163166
mod_heap = NULL;
167+
#endif
164168
} else {
165169
#ifdef CONFIG_SOF_USERSPACE_LL
166170
mod_heap = sof_sys_user_heap_get();

src/schedule/zephyr_dp_schedule.c

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

352-
static struct scheduler_ops schedule_dp_ops = {
352+
APP_SYSUSER_DATA static struct scheduler_ops schedule_dp_ops = {
353353
.schedule_task = scheduler_dp_task_shedule,
354354
#if CONFIG_SOF_USERSPACE_APPLICATION
355355
.schedule_task_cancel = scheduler_dp_task_cancel,
@@ -364,8 +364,8 @@ __cold int scheduler_dp_init(void)
364364
{
365365
assert_can_be_cold();
366366

367-
struct scheduler_dp_data *dp_sch = rzalloc(SOF_MEM_FLAG_KERNEL,
368-
sizeof(struct scheduler_dp_data));
367+
struct scheduler_dp_data *dp_sch = sof_heap_alloc(sof_sys_user_heap_get(),
368+
SOF_MEM_FLAG_KERNEL, sizeof(*dp_sch), 0);
369369
if (!dp_sch)
370370
return -ENOMEM;
371371

0 commit comments

Comments
 (0)