Expose static objects used by audio pipeline framework to LL user thread#10794
Open
kv2019i wants to merge 8 commits into
Open
Expose static objects used by audio pipeline framework to LL user thread#10794kv2019i wants to merge 8 commits into
kv2019i wants to merge 8 commits into
Conversation
Commit b76dd88 ("zephyr: rtos: userspace_helper.h: add sysuser memory partition") added macros APP_SYSUSER_BSS and APP_SYSUSER_DATA, but did not define them for the case if CONFIG_USERSPACE is not defined. Add definitions that handle this case as well. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Commit b76dd88 ("zephyr: rtos: userspace_helper.h: add sysuser memory partition") added macros APP_SYSUSER_BSS and APP_SYSUSER_DATA, but did not add them for posix headers. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The platform data descriptions need to be accessible to all system threads. These are e.g. used when setting up host/DAI copiers and they need platform DMA properties. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Allow the copier endpoint interface ops to be used also from user-space system threads. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The FPI sync functionality relies on static global objects. Make these available to the SOF application even when it is run in user-space. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Make the scheduler list available to system user-space threads. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Annotate the static comp_driver_list with APP_SYSUSER_BSS so that it is placed in the sysuser memory partition. This makes the component driver registry accessible from user-space threads when CONFIG_SOF_USERSPACE_LL is enabled. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Mark the fw_reg mutex with APP_SYSUSER_BSS, allowing the lock to be used when DAI module is run in user-space. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Collaborator
Author
|
For context, part of #10558 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates SOF’s Zephyr userspace support so selected global/static objects used by the audio pipeline framework are placed into a dedicated “system user” memory partition, making them accessible to the LL audio user thread when building with CONFIG_SOF_USERSPACE_LL (and remaining a no-op otherwise).
Changes:
- Added
APP_SYSUSER_BSS/APP_SYSUSER_DATAmacros (no-ops when userspace/LL userspace is not enabled; mapped tosysuser_partitionwhen it is). - Annotated several static/global objects (scheduler registry, DMA device table, copier interfaces, IPC4 DAI mutex, component driver list, etc.) with
APP_SYSUSER_*to ensure accessibility from the LL userspace context. - Added required includes where these macros are used in Zephyr code.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
zephyr/schedule.c |
Places the per-core scheduler registry pointer array in sysuser-accessible BSS for LL userspace builds. |
zephyr/lib/dma.c |
Places the global Zephyr DMA device table in sysuser-accessible data for LL userspace builds. |
zephyr/include/rtos/userspace_helper.h |
Defines APP_SYSUSER_BSS/DATA as no-ops when userspace is off; maps them to sysuser_partition when CONFIG_SOF_USERSPACE_LL is enabled. |
src/ipc/ipc4/dai.c |
Places the IPC4 LLP reading-slots mutex in sysuser-accessible BSS for LL userspace builds. |
src/audio/copier/copier.c |
Places copier module interface structures in sysuser-accessible data for LL userspace builds. |
src/audio/copier/copier_host.c |
Places the host copier sync-group list head in sysuser-accessible data for LL userspace builds. |
src/audio/component.c |
Places the component driver registry list in sysuser-accessible BSS for LL userspace builds. |
posix/include/rtos/userspace_helper.h |
Adds no-op definitions for APP_SYSUSER_BSS/DATA on POSIX builds. |
| @@ -34,8 +34,7 @@ | |||
|
|
|||
| LOG_MODULE_DECLARE(ipc, CONFIG_SOF_LOG_LEVEL); | |||
|
|
|||
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.
The audio application code has some uses of global objects. Expose all these objects with APP_SYSUSER_BSS/APP_SYSUSER_DATA so that the objects are accessible to the LL audio thread when SOF is built with CONFIG_SOF_USERSPACE_LL. In other builds, these macros are no-ops, so no functional change to other builds.