Skip to content

Expose static objects used by audio pipeline framework to LL user thread#10794

Open
kv2019i wants to merge 8 commits into
thesofproject:mainfrom
kv2019i:202605-ll-expose-static-audio-objs
Open

Expose static objects used by audio pipeline framework to LL user thread#10794
kv2019i wants to merge 8 commits into
thesofproject:mainfrom
kv2019i:202605-ll-expose-static-audio-objs

Conversation

@kv2019i
Copy link
Copy Markdown
Collaborator

@kv2019i kv2019i commented May 20, 2026

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.

kv2019i added 8 commits May 20, 2026 18:15
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>
Copilot AI review requested due to automatic review settings May 20, 2026 16:44
@kv2019i
Copy link
Copy Markdown
Collaborator Author

kv2019i commented May 20, 2026

For context, part of #10558

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_DATA macros (no-ops when userspace/LL userspace is not enabled; mapped to sysuser_partition when 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.

Comment thread src/ipc/ipc4/dai.c
@@ -34,8 +34,7 @@

LOG_MODULE_DECLARE(ipc, CONFIG_SOF_LOG_LEVEL);

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.

2 participants