Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLEXT: libraries with multiple modules #9688

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

Conversation

lyakh
Copy link
Collaborator

@lyakh lyakh commented Nov 27, 2024

Add support for libraries with multiple modules. This handles loading of libraries. Creation will be added later, isn't too complex, needs minor additions to cmake and Python.

Use section offset from the section header in
llext_manager_load_data_from_storage() to simplify calculations and
eliminate a function parameter.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
file_offset in struct lib_manager_segment_desc is unused, remove it.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
We don't need to store .bss address and size until the module is
freed since .bss is allocated together with .data and we only need
its size when initialising it, not when freeing module memory. Remove
it to save memory.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
Split man_get_module_manifest() into two functions in preparation for
multi-part relocatable module library support.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
The second preparatory step for multi-part relocatable module
libraries.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
free(NULL) is allowed, remove redundant checks.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
Rimage generates an image from multiple input modules. However, in
case of building libraries from multiple relocatable ELF files it
doesn't currently construct manifest correctly. It mixes up manifest
provided in TOML with manifest structures in ".module" sections of
modules. Clean this up to only use manifests from ELF and append
configuration from TOML.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
Remove unused arguments from llext_manager_load_module(),
llext_manager_unload_module() and llext_manager_link().

Signed-off-by: Guennadi Liakhovetski <[email protected]>
Run-time loadable SOF libraries can contain multiple modules. To
prepare to support them add a module context type.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
Zephyr logging prints function names, no need to include them
explicitly.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
NULL checking should be done before dereferencing, not after. Also
rearrange varoable definition in llext_manager_allocate_module() to
make it more logical.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
llext_manager_allocate_module() should return 0 when failing, not an
error code.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
Loadable libraries can contain multiple modules, where each module
can contain multiple manifest entries, e.g. when providing multiple
Module Adapter drivers. This commit adds support for such libraries,
built by specifying all the modules on rimage command line.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
mux.toml doesn't have a demux entry in it, therefore we cannot have
one in .module either, remove it until fixed. Also fix a copy-paste
error in the same code block.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant