Skip to content

Commit db214ec

Browse files
committed
llext: with userspace let LL thread access DP modules too
If LL runs in userspace, it needs access to loaded LLEXT modules, running in DP more too. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent cf63f48 commit db214ec

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

src/library_manager/llext_manager.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,18 +299,20 @@ static int llext_manager_load_module(struct lib_manager_module *mctx)
299299
memset((__sparse_force void *)bss_addr, 0, bss_size);
300300
mctx->mapped = true;
301301

302-
if (!mctx->domain_dp) {
303-
ret = llext_manager_add_mod_domain(mctx, zephyr_ll_mem_domain());
304-
if (ret < 0) {
305-
tr_err(&lib_manager_tr, "failed to add domain: %d", ret);
306-
goto e_data;
307-
}
302+
#ifdef CONFIG_SOF_USERSPACE_LL
303+
ret = llext_manager_add_mod_domain(mctx, zephyr_ll_mem_domain());
304+
if (ret < 0) {
305+
tr_err(&lib_manager_tr, "failed to add domain: %d", ret);
306+
goto e_data;
308307
}
308+
#endif
309309

310310
return 0;
311+
#ifdef CONFIG_SOF_USERSPACE_LL
311312
e_data:
312313
if (data_size)
313314
llext_manager_align_unmap(va_base_data, data_size);
315+
#endif
314316
e_rodata:
315317
if (rodata_size)
316318
llext_manager_align_unmap(va_base_rodata, rodata_size);
@@ -370,8 +372,9 @@ static int llext_manager_unload_module(struct lib_manager_module *mctx)
370372

371373
mctx->mapped = false;
372374

373-
if (!mctx->domain_dp)
374-
llext_manager_rm_mod_domain(mctx, zephyr_ll_mem_domain());
375+
#ifdef CONFIG_SOF_USERSPACE_LL
376+
llext_manager_rm_mod_domain(mctx, zephyr_ll_mem_domain());
377+
#endif
375378

376379
return err;
377380
}

0 commit comments

Comments
 (0)