|
26 | 26 | #include <stdint.h> |
27 | 27 |
|
28 | 28 | #include <sof/lib_manager.h> |
| 29 | +#include <sof/llext_manager.h> |
29 | 30 | #include <sof/audio/component.h> |
30 | 31 | #include <sof/schedule/dp_schedule.h> |
31 | 32 | #include <rtos/userspace_helper.h> |
@@ -163,6 +164,7 @@ static int user_work_item_init(struct userspace_context *user_ctx, struct k_heap |
163 | 164 | work_item->event = &worker.event; |
164 | 165 | #endif |
165 | 166 | work_item->params.context = user_ctx; |
| 167 | + work_item->params.mod = NULL; |
166 | 168 | user_ctx->work_item = work_item; |
167 | 169 |
|
168 | 170 | return 0; |
@@ -382,7 +384,7 @@ static int userspace_proxy_start_agent(struct userspace_context *user_ctx, |
382 | 384 | } |
383 | 385 |
|
384 | 386 | int userspace_proxy_create(struct userspace_context **user_ctx, const struct comp_driver *drv, |
385 | | - const struct sof_man_module *manifest, system_agent_start_fn start_fn, |
| 387 | + const struct sof_man_module *manifest, system_agent_start_fn agent_fn, |
386 | 388 | const struct system_agent_params *agent_params, |
387 | 389 | const void **agent_interface, const struct module_interface **ops) |
388 | 390 | { |
@@ -410,15 +412,20 @@ int userspace_proxy_create(struct userspace_context **user_ctx, const struct com |
410 | 412 | if (ret) |
411 | 413 | goto error_dom; |
412 | 414 |
|
413 | | - ret = userspace_proxy_add_sections(context, agent_params->instance_id, manifest); |
| 415 | + if (agent_fn) |
| 416 | + ret = userspace_proxy_add_sections(context, agent_params->instance_id, manifest); |
| 417 | + else |
| 418 | + /* llext modules do not use the system agent. */ |
| 419 | + ret = llext_manager_add_domain(agent_params->module_id, domain); |
| 420 | + |
414 | 421 | if (ret) |
415 | 422 | goto error_dom; |
416 | 423 |
|
417 | 424 | ret = user_work_item_init(context, drv->user_heap); |
418 | 425 | if (ret) |
419 | 426 | goto error_dom; |
420 | 427 |
|
421 | | - ret = userspace_proxy_start_agent(context, start_fn, agent_params, agent_interface); |
| 428 | + ret = userspace_proxy_start_agent(context, agent_fn, agent_params, agent_interface); |
422 | 429 | if (ret) { |
423 | 430 | tr_err(&userspace_proxy_tr, "System agent failed with error %d.", ret); |
424 | 431 | goto error_work_item; |
|
0 commit comments