Repository navigation
Conversation
Phase 2 of the kernel / user-space partition (thesofproject#11306) moves the code that only runs in kernel mode to src/kernel. The firmware init code is the first: it brings up the SOF context and runs from SYS_INIT() in supervisor mode. Move it to src/kernel/init and add src/kernel/CMakeLists.txt, which the Zephyr build now adds instead of src/init. Update the paths in the README and in a ztest comment. Only Zephyr builds src/init, so the host builds are not affected. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add a sof_kernel Zephyr library for the code in src/kernel, so that kernel-only code is built separately from modules_sof and can later be given include directories of its own. The library is created in zephyr/CMakeLists.txt, next to modules_sof, so that it gets the same directory-level compile definitions, and it links the same SOF interface library. It is created first so that modules_sof stays the current Zephyr library there. src/kernel/CMakeLists.txt makes sof_kernel the current library for its own directory tree, so the CMake files of the directories moved there need no change. The trace relative paths are set for it as well. Like all Zephyr libraries it is linked as a whole archive, so the SYS_INIT() entries it holds are kept and their order is unchanged. The generated code is unchanged; only the link order, and with it the alignment padding in some sections, changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The inter-core communication code only runs in kernel mode. Move it to src/kernel/idc, where it is built into the sof_kernel library. Add src/kernel/Kconfig for the Kconfig files of the moved directories and source it from src/Kconfig in place of idc/Kconfig. The option values are unchanged. Fix the relative link in the README. Only Zephyr builds the IDC code, so the host builds are not affected. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
AGENTS.md, the user-space README and the audio README list the kernel-only directories by name and still name src/init and src/idc, which are now under src/kernel. List src/kernel, note that it is built into the sof_kernel library, and keep the directories that have not moved there yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
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 2 of #11306 (kernel / user-space partition), second part: move the inter-core communication code to
src/kernel/idc. Stacked on #11394: its two commits come first and will drop out when it is merged.Patches
src/idc→src/kernel/idc: a pure move. The code is now built into thesof_kernellibrary added in Phase 2 (part 1): add src/kernel and a sof_kernel library, move src/init #11394.src/kernel/Kconfigsources the Kconfig files of the moved directories.src/Kconfigsources it in place ofidc/Kconfig, and the option values are unchanged.AGENTS.md, the user-space README and the audio README list the kernel-only directories by name. They now listsrc/kernel, note thesof_kernellibrary, and keep the directories that have not moved yet. This also coverssrc/init, which Phase 2 (part 1): add src/kernel and a sof_kernel library, move src/init #11394 moved but did not update here.Functional change
None. The objects are unchanged, and every build's
.confighas the same option values before and after. As in #11394, the only effect is on link order: in every firmware image the symbols (name, type and size) and theSYS_INIT()order are identical, and only alignment padding in some sections changes. Two more link-order effects:kobject_hash.c,wordlist) changes size. gperf generates it from the kernel objects' addresses, which move with the link order.sof_init()changes size with the commit hash it embeds, as explained in Phase 2 (part 1): add src/kernel and a sof_kernel library, move src/init #11394.Testing
CONFIG_SOF_USERSPACE_PROXY=n;os_linux_overlay.conf;llext_relocatable.conf.SYS_INIT()order and section sizes.sof-hda-generic-cavs25-2ch.tplgboots, plays 5 s on the HDA analog PCM, and plays again after runtime suspend, with no DSP errors.All of the above was run on 78b23ad (current main) with #11394 applied.
🤖 Generated with Claude Code