Repository navigation
Conversation
The copier DAI and IPC4 DAI code checks ACE_VERSION > ACE_VERSION_1_5 for the gateway handling that changed after ACE 1.5, which makes it include sof/platform.h for the ACE version header. Add a hidden Kconfig option that is set for ACE 2.0 and later, matching how zephyr/Kconfig already tests the ACE version, and use it instead. No functional change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Liam Girdwood <[email protected]>
The copier DAI and IPC4 DAI code only included sof/platform.h for ACE_VERSION, which they no longer use. No functional change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Liam Girdwood <[email protected]>
The DRC, multiband DRC and SRC sources only use __cold from sof/lib/memory.h, so include sof/lib/cold.h instead. asrc_farrow.c and src.c use nothing from it. No functional change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Liam Girdwood <[email protected]>
Drop rtos/interrupt.h, rtos/timer.h, rtos/wait.h and rtos/userspace_helper.h from the audio sources that use nothing from them, and sof/lib_manager.h from modules.c. pipeline-stream.c includes rtos/timer.h, whose timestamp helpers it uses, instead of rtos/wait.h. The pipeline graph, the pipeline scheduler, the copier and the xrun code keep the includes whose IRQ locking and timer helpers they still use. No functional change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Liam Girdwood <[email protected]>
peak_vol_update() writes the peak meter to the IPC4 mailbox registers, and is only called from volume.c. Defining it in volume.h made every volume source include sof/lib/mailbox.h and, through it, the platform memory map. Move it to volume.c, under CONFIG_COMP_PEAK_VOL like its only caller, and include sof/lib/mailbox.h in volume.c and volume_ipc4.c, the two sources that write the mailbox. No functional change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Liam Girdwood <[email protected]>
lgirdwood
force-pushed
the
kernel-user/phase1d
branch
from
November 1, 2026 19:32
6757b6e to
d5549ca
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the kernel-header dependency cleanup.
No open issues 🎉
What changed in this PR
This PR reduces kernel-header dependencies in SOF user-space code, advancing the kernel/user-space partition in #11306 without intended functional changes. The reviewed diff also includes the stacked cleanup from #11364.
Changes:
- Replaces platform-header dependencies with Kconfig options, centralized cache helpers, and narrower component and scheduler headers.
- Removes unused kernel includes and adds direct includes where needed.
- Moves the volume peak-update helper into
volume.c, removing the mailbox dependency from the shared volume header.
| File | Description |
|---|---|
zephyr/include/rtos/cache.h |
Centralizes platform cache-alias helpers. |
test/cmocka/src/audio/mixer/mixer_test.c |
Uses the Kconfig stream limit. |
src/probe/probe.c |
Removes unused component extension include. |
src/platform/tigerlake/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/qemu_xtensa/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/posix/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/posix/include/platform/lib/memory.h |
Removes relocated cache-alias macros. |
src/platform/novalake/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/mtk/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/mtk/include/platform/lib/memory.h |
Removes relocated cache-alias macros. |
src/platform/meteorlake/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/lunarlake/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/library/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/library/include/platform/lib/memory.h |
Removes relocated cache-alias macros. |
src/platform/Kconfig |
Defines stream limits and ACE-version capability. |
src/platform/intel/cavs/include/cavs/lib/memory.h |
Removes relocated cache-alias helpers. |
src/platform/intel/ace/include/ace/lib/memory.h |
Removes relocated cache-alias macros. |
src/platform/imx95/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/imx95/include/platform/lib/memory.h |
Removes relocated cache-alias macros. |
src/platform/imx93_a55/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/imx93_a55/include/platform/lib/memory.h |
Removes relocated cache-alias macros. |
src/platform/imx8ulp/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/imx8ulp/include/platform/lib/memory.h |
Removes relocated cache-alias macros. |
src/platform/imx8m/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/imx8m/include/platform/lib/memory.h |
Removes relocated cache-alias macros. |
src/platform/imx8m_cm7/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/imx8m_cm7/include/platform/lib/memory.h |
Removes relocated cache-alias macros. |
src/platform/imx8/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/imx8/include/platform/lib/memory.h |
Removes relocated cache-alias macros. |
src/platform/amd/rembrandt/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/amd/rembrandt/include/platform/lib/memory.h |
Removes relocated cache-alias macros. |
src/platform/amd/acp_7_x/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/amd/acp_7_x/include/platform/lib/memory.h |
Removes relocated cache-alias macros. |
src/platform/amd/acp_7_0/include/platform/platform.h |
Removes migrated stream limit. |
src/platform/amd/acp_7_0/include/platform/lib/memory.h |
Removes relocated cache-alias macros. |
src/platform/ace30/include/platform/platform.h |
Removes migrated stream limit. |
src/library_manager/lib_manager.c |
Adds direct DMA include. |
src/ipc/ipc4/helper.c |
Uses Kconfig for ACE-version selection. |
src/ipc/ipc4/dai.c |
Replaces platform version checks with Kconfig. |
src/ipc/ipc3/handler.c |
Adds direct DAI include. |
src/ipc/ipc3/dai.c |
Includes the extracted DAI component helper. |
src/include/sof/tlv.h |
Adds direct RTOS string include. |
src/include/sof/schedule/ll_schedule.h |
Receives timer constants and user scheduling-lock declarations. |
src/include/sof/schedule/ll_schedule_domain.h |
Delegates relocated declarations to ll_schedule.h. |
src/include/sof/coherent.h |
Uses cache header instead of memory map. |
src/include/sof/audio/component.h |
Includes cold-code attributes directly. |
src/include/sof/audio/component_ext.h |
Removes DAI helper and dependency. |
src/include/sof/audio/component_dai.h |
Houses the extracted DAI configuration helper. |
src/audio/volume/volume.h |
Removes peak-update helper and mailbox include. |
src/audio/volume/volume.c |
Hosts the private peak-update helper. |
src/audio/volume/volume_ipc4.c |
Makes mailbox dependency explicit; removes unused include. |
src/audio/volume/volume_ipc3.c |
Removes unused component extension include. |
src/audio/up_down_mixer/up_down_mixer.h |
Removes unused component extension include. |
src/audio/up_down_mixer/up_down_mixer_hifi3.c |
Adds panic include for fallback stubs. |
src/audio/src/src.c |
Removes unused memory-map include. |
src/audio/src/src_ipc4.c |
Uses narrower scheduler and cold-attribute headers. |
src/audio/src/src_common.c |
Replaces memory-map include with cold attributes. |
src/audio/pipeline/static_pipeline_modules.c |
Removes unused component extension include. |
src/audio/pipeline/static_pipeline_loader.c |
Includes the extracted DAI component helper. |
src/audio/pipeline/pipeline-xrun.c |
Removes unused component extension include. |
src/audio/pipeline/pipeline-stream.c |
Uses direct timer and narrower scheduler headers. |
src/audio/pipeline/pipeline-schedule.c |
Removes unused scheduler-domain and userspace-helper includes. |
src/audio/pipeline/pipeline-graph.c |
Narrows scheduler dependency; removes unused helper include. |
src/audio/mux/mux.h |
Uses Kconfig stream limit without platform header. |
src/audio/multiband_drc/multiband_drc.c |
Replaces memory-map include with cold attributes. |
src/audio/multiband_drc/multiband_drc_ipc4.c |
Replaces memory-map include with cold attributes. |
src/audio/module_adapter/module/modules.c |
Removes unused userspace-helper and library-manager includes. |
src/audio/module_adapter/module/cadence_ipc4.c |
Uses narrower scheduler header. |
src/audio/module_adapter/module_adapter.c |
Uses Kconfig stream limits and narrower scheduler header. |
src/audio/module_adapter/module_adapter_ipc4.c |
Removes unused interrupt include. |
src/audio/module_adapter/library/native_system_service.c |
Removes unused userspace-helper include. |
src/audio/module_adapter/library/kpb_service_bridge.c |
Removes unused userspace-helper include. |
src/audio/mixer/mixer.c |
Uses Kconfig stream limit without platform header. |
src/audio/intel_uaol.c |
Adds direct logging include; removes component extension dependency. |
src/audio/google/google_rtc_audio_processing.c |
Removes unused wait include. |
src/audio/drc/drc.c |
Replaces memory-map include with cold attributes. |
src/audio/copier/ipcgtw_copier.h |
Removes unused component extension include. |
src/audio/copier/host_copier.h |
Removes unused component extension include. |
src/audio/copier/copier.c |
Narrows dependencies and adds direct DAI include. |
src/audio/copier/copier_ipcgtw.c |
Removes unused component extension include. |
src/audio/copier/copier_host.c |
Uses cold attributes; removes unused includes. |
src/audio/copier/copier_hifi.c |
Uses cold attributes; removes component extension include. |
src/audio/copier/copier_generic.c |
Uses narrower component and cold-attribute headers. |
src/audio/copier/copier_gain.c |
Uses direct component, DAI, and cold-attribute headers. |
src/audio/copier/copier_dai.c |
Uses extracted DAI helper and Kconfig ACE check. |
src/audio/component.c |
Removes unused interrupt include. |
src/audio/chain_dma.c |
Removes unused component extension and scheduler-domain includes. |
src/audio/buffers/comp_buffer.c |
Removes unused userspace-helper include. |
src/audio/asrc/asrc_farrow.c |
Removes unused memory-map include. |
src/audio/aria/aria.h |
Removes unused component extension include. |
posix/include/sof/lib/memory.h |
Includes relocated host cache helpers. |
posix/include/rtos/cache.h |
Hosts identity cache-alias helpers. |
Review effort: Balanced
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.
Phase 1 of #11306 (kernel / user-space partition), fourth part: more include cleanup in user-space code, with no functional change. Follows #11364.
Patches
CONFIG_ACE_VERSION_2_0_OR_LATER(new): a hidden Kconfig option set for ACE 2.0 and later. The copier DAI and IPC4 DAI code use it instead ofACE_VERSION > ACE_VERSION_1_5, which needed the platform version header.zephyr/Kconfigalready tests the ACE version the same way.sof/platform.h: dropped from the copier DAI and IPC4 DAI code, which only used it forACE_VERSION.sof/lib/cold.hinstead ofsof/lib/memory.h;__coldis all they used.asrc_farrow.candsrc.cdrop it.rtos/interrupt.h,rtos/timer.h,rtos/wait.handrtos/userspace_helper.hare dropped from the audio sources that use nothing from them, andsof/lib_manager.hfrommodules.c.pipeline-stream.cincludesrtos/timer.h, which it uses, instead ofrtos/wait.h.peak_vol_update()moves fromvolume.htovolume.c, its only caller, so the other volume sources no longer includesof/lib/mailbox.h.Effect
Measured with
scripts/check_kernel_includes.pyon PTL, as the number of user-space sources including each header, before and after this PR:sof/lib/memory.h(platform memory map)sof/lib/mailbox.hrtos/clk.hsof/platform.hrtos/userspace_helper.hrtos/timer.hrtos/interrupt.hNot in this PR
What remains is mostly real kernel use from user-space code:
MAILBOX_HOSTBOX_SIZE/MAILBOX_DSPBOX_SIZEin the data blob and module adapter code.dai-zephyr.c,host-zephyr.c, chain DMA, and asrc's DAI timestamping.component_ext.h: used by the pipeline.perf_cnt;lib_manager.h, which is a mixed header.pipeline-stream.candlib/dma.c: both reach into the copier's private data ("../audio/copier/copier.h"). Fixing that needs a small copier API, which is better discussed on its own.Testing
CONFIG_SOF_USERSPACE_PROXY=n;os_linux_overlay.conf;llext_relocatable.conf.CONFIG_ACE_VERSION_2_0_OR_LATERis set on LNL, PTL, WCL and NVL and not on MTL.All of the above was run on 5d007c0 (current main, including #11364).
🤖 Generated with Claude Code