audio: module-adapter: make generic code compatible with user-space#10950
Open
kv2019i wants to merge 2 commits into
Open
audio: module-adapter: make generic code compatible with user-space#10950kv2019i wants to merge 2 commits into
kv2019i wants to merge 2 commits into
Conversation
Collaborator
Author
|
For context, part of #10558 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to make generic module-adapter and data blob handling code safe/usable from user-space contexts by switching allocations to user-safe heap APIs and threading a heap choice through the data blob handler creation path.
Changes:
- Extend
comp_data_blob_handler_new_ext()with an optionalstruct k_heap *heapparameter and update the default wrapper. - Update generic module configuration/runtime allocations to use
sof_heap_alloc()/sof_heap_free()(withsof_sys_user_heap_get()). - Pass the module allocator heap into
comp_data_blob_handler_new_ext()frommod_data_blob_handler_new().
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/include/sof/audio/data_blob.h | Extends blob handler constructor API with an optional heap parameter and updates the inline wrapper. |
| src/audio/module_adapter/module/generic.c | Replaces config/runtime rballoc/rfree usage with sof_heap_alloc/sof_heap_free and passes allocator heap into blob handler creation. |
| src/audio/data_blob.c | Stores heap in the handler, allocates/frees handler via heap when provided, and adds “default heap” alloc/free helpers. |
Use user-space friendy sof_heap_alloc() for dynamic allocations in data_blob handler. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Replace direct rballoc() and rfree() calls with sof_heap_alloc() and sof_heap_free(), and use sof_sys_user_heap_get() as the heap. This makes the code ready to be used in user-space, including module prepare and free stages. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
82045ae to
dfc1660
Compare
Collaborator
Author
|
V2 pushed:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Series of patches to make generic module code safe to use from user-space.