Repository navigation
Conversation
The architecture code (Xtensa cache and interrupt support, the host build's architecture layer and its library defconfig) is kernel-only. Move it to src/kernel/arch. Zephyr only uses it through include directories and the Xtensa cache attribute source listed in zephyr/CMakeLists.txt; update those paths. The host builds now add it from src/kernel. Update the configuration search paths in kconfig.cmake and defconfigs.cmake, the testbench, tplg_parser and app CMake, the MediaTek tools script and the docs. Its Kconfig is sourced from the same place in src/Kconfig as before, so the Kconfig definition order does not change. References to the removed XTOS build output (build_<plat>_gcc/src/arch/xtensa) in old scripts and .gitignore are left as they are. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The platform code (memory maps, clocks, interrupts, platform init and the host library and posix platform layers) is kernel-only. Move it to src/kernel/platform. Point SOF_PLATFORM_PATH in zephyr/CMakeLists.txt to the new location; the two i.MX linker snippets now use it as well. The host builds now add it from src/kernel. Update the include directories of the cmocka and ztest unit tests, the testbench and tplg_parser, the platform header patterns in the include checker's manifest, CODEOWNERS, the MediaTek tools script and the docs. Its Kconfig is sourced from the same place in src/Kconfig as before, so the Kconfig definition order does not change. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
zephyr/CMakeLists.txt lists the platform, driver and Xtensa cache attribute sources itself, mixed with the Zephyr integration sources in zephyr/lib, so they are built into modules_sof although they now live under src/kernel. After all sources have been added, move every source under src/kernel from modules_sof to sof_kernel, so that sof_kernel holds exactly the code in src/kernel however it was added. Both libraries are created in the same directory and link the same SOF interface library, so the compile flags do not change. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The Kconfig options of the SOF probe log backend (CONFIG_LOG_BACKEND_SOF_PROBE*) are defined in src/trace/Kconfig, which is otherwise only about the SOF DMA trace. Move them to a Kconfig file next to the backend, in src/kernel/logging, sourced from src/kernel/Kconfig. The option values are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The host builds (testbench, host library) print their traces to stderr through the CONFIG_LIBRARY part of trace-soflogger.h, which is only included when CONFIG_TRACE is set. CONFIG_TRACE also builds the SOF DMA trace, which the host builds do not need. Move the host printing to a header of its own, trace-host.h, and use it for CONFIG_LIBRARY builds. It maps tr_err(), tr_warn(), tr_info(), tr_dbg() and the component trace macros to the same levels and output as before, which is what the host library got with CONFIG_TRACEV and CONFIG_TRACEE set. Disable CONFIG_TRACE for the host library, build the host trace support unconditionally, and drop CONFIG_TRACEV from library_defconfig. The host library code is unchanged; only the trace contexts move from the .trace_ctx section, which only the firmware dictionary logger uses, to normal data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The SOF DMA trace (CONFIG_TRACE) sends dictionary-encoded traces for the sof-logger tool over a host DMA channel. Zephyr builds use Zephyr logging instead and cannot enable it at all: zephyr/include/sof/trace/ preproc.h stops the build if CONFIG_TRACE is set. Since the previous patch the host builds do not use it either, so nothing builds it any more. Remove it: - src/trace with its Kconfig (CONFIG_TRACE, CONFIG_TRACEV, CONFIG_TRACEE, CONFIG_TRACEM and the trace filtering options), trace-soflogger.h and dma-trace.h; - the IPC DMA copy helper (src/ipc/dma-copy.c) and CONFIG_TRACE_CHANNEL, used only by the DMA trace; - the code under CONFIG_TRACE in the IPC3 handler (the DMA trace and trace filter commands; the stub that accepts trace commands without a DMA trace stays), the i.MX and AMD platform init, the system init, the panic handler and the cmocka mocks, and the DMA trace calls in the IPC3 PM gate handler; - the trace position helpers ipc_build_trace_posn() and ipc_trigger_trace_xfer(), the trace and DMA trace fields of struct sof, and dump_hex() with the two CONFIG_TRACEV blocks in the Waves module that used it; - the CONFIG_TRACE=n settings in the board and application configs, and the CONFIG_TRACE_CHANNEL settings in the cmocka defconfigs. trace.h keeps the Zephyr logging, host and no-op trace macros. The IPC trace structures in include/ipc/trace.h are host ABI and stay. The dma_copy_*() declarations and DMA_TRACE_CHANNEL are still referenced by the legacy (non-native driver) probe and AMD DMA code and are left for the removal of that code. No firmware build compiled the DMA trace itself. The firmware does change in two ways: the unused ipc_build_trace_posn() and ipc_trigger_trace_xfer() are no longer built, and struct sof is two pointers smaller, which changes the field offsets in the code that uses it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
With src/trace removed, src/kernel holds all directories of kernel-only code. Update AGENTS.md and the user-space README, which listed the directories not yet moved there, and the init README, which still described the DMA trace initialization. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
ipc-common.c mixes code that only runs in kernel mode with code that also runs in the user-space IPC thread. Move the kernel part to src/kernel/ipc/ipc-common-kernel.c: - the IPC context and ipc_get() of user-space LL builds; - the IPC task, command completion and IDC forwarding to other cores; - the outgoing message queue and its work queue, and the kernel half of the ipc_msg_send() and ipc_msg_list_remove() system calls; - the setup of the user-space IPC threads, their kernel-only object copies and command forwarding to them; - ipc_init(). ipc-common.c keeps message allocation, the component lookups and, for user-space LL builds, the user-space IPC thread function and the default command dispatch. The user thread entry point and its event bits are now shared through sof/ipc/common.h. The unit tests that build ipc-common.c also build the kernel part. The code is unchanged. Only the Xtensa assembler's alignment padding and its choice between narrow and wide encodings of the same instructions differ in a few functions, as do the line numbers the moved functions pass to the assertion handler in builds with assertions (qemu_xtensa). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
handler-user.c mixes the IPC4 global and module message routers, which run in the kernel IPC thread, with the handlers that also run in the user-space IPC thread. Move the kernel part to src/kernel/ipc/ipc4/handler-user-kernel.c: - the global and module message routers and the reply message they fill in; - the forwarding to the user-space IPC thread: the target core lookup, the multicore SET_PIPELINE_STATE sequencing and the MOD_INIT_INSTANCE driver lookup and module loading; - the CHAIN_DMA, IPC gateway and GDB commands; - the module init that runs in the kernel (DP modules and builds without user-space LL) and the base firmware LARGE_CONFIG get and set, which use IDC and the IMR manifest; - the thin wrappers that the routers of builds without user-space LL call directly. handler-user.c keeps the pipeline state handling, the module config and large config processing and the user-space IPC thread dispatch. The pipeline ID lookup and the vendor config and kcontrol helpers, which both parts use, are no longer static and are declared in ipc4/handler.h. handler-user.c no longer needs the IPC gateway copier header. The code is unchanged, but the compiler can no longer inline or specialise the shared helpers in the callers on the other side of the split. Their callers now pass the full argument list instead of calling GCC's constant-propagated clones, ipc4_set_pipeline_state() only partially inlines ipc4_pipeline_id_get() in builds without user-space LL, and the register allocation of the routers differs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
helper.c mixes the IPC4 topology helpers, which also run in the user-space IPC thread, with code that needs kernel mode. Move the kernel part to src/kernel/ipc/ipc4/helper-kernel.c: - the component driver lookup, which reads the IMR manifest, registers loadable modules with the library manager and walks the driver list; - comp_new_ipc4(), the module creation of the kernel IPC thread (DP modules and builds without user-space LL), and the privileged part of the user-space module creation, ipc4_user_module_load(); - the IDC helpers, ipc4_process_on_core() and ipc_comp_free_remote(); - the chain DMA manager, which only the kernel CHAIN_DMA command uses. helper.c keeps the pipeline and component management, binding and the DMA config parsing. The module config parsing and the module init payload lookup, which both parts use, are no longer static and are declared in sof/ipc/topology.h, as is ipc_comp_free_remote(). helper.c no longer includes the rimage manifest, platform memory map and library manager headers. The code is unchanged, but the functions that now call across the split can no longer inline their callees: ipc_pipeline_new(), ipc_pipeline_free(), ipc4_comp_connect() and ipc4_comp_disconnect() call ipc4_process_on_core() and ipc_comp_free_remote(), and comp_new_ipc4(), ipc4_user_module_load() and ipc4_chain_manager_create() call the module config and component list helpers, instead of inlining them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…hedule zephyr_domain.c mixes the LL scheduler thread function and the parts of the timer domain that run in the LL scheduler threads with the thread and timer setup, which needs kernel mode. Move the kernel part to src/kernel/schedule/zephyr_domain-kernel.c: - the LL scheduler thread stacks and the timer interrupt handler; - domain register and unregister of builds without user-space LL, which create and abort the scheduler threads and start and stop the timer; - the user-space LL thread init and free, the kernel-only per-core thread table and the thread lookups used for access grants; - the domain ops and zephyr_domain_init(). zephyr_domain.c keeps the thread function, the user-space LL register and unregister bookkeeping, the cross-core stream block and unblock and ll_sch_is_current(). The domain data structures and the functions the kernel part refers to are declared in the new scheduler-private header sof/schedule/zephyr_ll.h. zephyr_domain.c no longer includes the timer, userspace helper, platform and memory map headers. The code is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
zephyr_ll.c is the LL scheduler, which runs in the LL scheduler threads and, with user-space LL, in user mode. Its setup and a few other parts need kernel mode. Move them to src/kernel/schedule/zephyr_ll-kernel.c: - zephyr_ll_scheduler_init() and the scheduler ops, which allocate the per-core scheduler data and lock and register the scheduler at boot; - the kernel half of the zephyr_ll_task_sem_alloc() and zephyr_ll_task_sem_free() system calls, which allocate the per-task semaphores as kernel objects and grant the LL thread access to them; - zephyr_ll_init_context(), which sets up the LL thread of a core and grants it access to the scheduler lock and the task semaphore; - user_ll_grant_access(), which grants a thread access to the scheduler lock of a core. The scheduler and per-task data structures, the per-core lock table and the scheduler ops are declared in sof/schedule/zephyr_ll.h. The kernel part is built under the same condition as zephyr_ll.c. The code is unchanged, but the compiler inlines differently in the smaller zephyr_ll.c: in builds with user-space support, zephyr_ll_task_done() now inlines the system call wrapper of a log message instead of calling an out-of-line copy of it, and the register allocation of zephyr_ll_task_free() and zephyr_ll_task_init() differs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
zephyr_dp_schedule.h holds the DP scheduler data structures and helpers shared by the DP scheduler sources. The kernel parts of those sources move to src/kernel/schedule in the next patches and need it too, so move it to sof/schedule/zephyr_dp_schedule.h. Add the include guard that it did not have. The generated code is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…el/schedule zephyr_dp_schedule.c holds the DP scheduler code common to its thread and application variants. Part of it needs kernel mode. Move it to src/kernel/schedule/zephyr_dp_schedule-kernel.c: - the per-core DP scheduler locks, which are kernel objects, and scheduler_dp_grant(), which grants threads access to them; - the scheduler_dp_ll_tick() system call, with the description of the DP scheduling it drives; - scheduler_dp_init(), which allocates the per-core scheduler data, registers the scheduler and its ops at boot and sets up the LL tick task, together with the scheduler UUID, trace context and log module. zephyr_dp_schedule.c keeps the lock and unlock helpers, the task schedule, stop, cancel and free ops and the task info query. The locks and the ops are declared in sof/schedule/zephyr_dp_schedule.h. The code is unchanged, but z_impl_scheduler_dp_ll_tick() now calls the lock and unlock helpers instead of inlining them, and in the application variant scheduler_dp_task_free() calls scheduler_dp_task_stop() instead of inlining it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…rc/kernel/schedule In the thread variant of the DP scheduler, scheduler_dp_task_init() allocates the DP thread, its stack and event, creates and pins the thread and, for user-space modules, grants it access to its objects and adds it to the module memory domain. Move it, and the kernel half of the scheduler_dp_internal_free() system call, which frees those objects, to src/kernel/schedule/zephyr_dp_schedule_thread-kernel.c. zephyr_dp_schedule_thread.c keeps the DP thread function and the task readiness and deadline calculation. The code is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…nto src/kernel/schedule In the application variant of the DP scheduler, scheduler_dp_task_init() allocates the DP thread and its kernel objects, sets up the memory domain of the module, grants the DP, IPC and LL threads access, and records the kernel objects of the task in a kernel-only list. Move it to src/kernel/schedule/zephyr_dp_schedule_application-kernel.c, with: - the kernel object record list and its helpers; - the memory domain pool and teardown; - the kernel half of the scheduler_dp_internal_free() system call and its verification of the caller; - the per-core DP thread synchronization semaphores, which are kernel objects. zephyr_dp_schedule_application.c keeps the IPC packing and unpacking, scheduler_dp_thread_ipc(), the task readiness and deadline calculation and the DP thread function. The task memory layout and the packed IPC structure, which both parts use, and the semaphores are declared in sof/schedule/zephyr_dp_schedule.h. The code is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The thread-with-budget scheduler is kernel-only code. It serializes with irq_lock(), including in its thread function, changes the priority and time slice of its threads, whose budget callback runs in interrupt context, and allocates the thread stacks itself. Move it to src/kernel/schedule, which builds it into sof_kernel, and update the scheduler README. The code is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
scheduler_init() and scheduler_register() allocate and register the schedulers at boot, on the kernel heap or, for the user-space schedulers with user-space LL, on the system user heap, and panic on failure. Move them to src/kernel/schedule/schedule-kernel.c. schedule.c keeps schedule_task_init() and the task info query. scheduler_is_user(), which both parts use, becomes a static inline in sof/schedule/schedule.h. The code is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Update the scheduler README for the split of the scheduler sources: the kernel parts are in src/kernel/schedule, the TWB scheduler is there in full, and the shared data structures are in sof/schedule/zephyr_ll.h and sof/schedule/zephyr_dp_schedule.h. Point the syscall table of the user-space README at the kernel files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
There was a problem hiding this comment.
🟡 Changes recommended
The build script’s four-parent traversal now resolves to the repository’s src directory rather than its root, producing incorrect source and include paths when run as documented.
1 open issue
What changed in this PR
Advances SOF’s kernel/user-space partition by moving privileged scheduler setup and syscall implementations into src/kernel/schedule, while retaining LL/DP thread execution in src/schedule. The reviewed changes also include stacked platform and architecture relocations, IPC build updates, and legacy DMA-trace cleanup.
Changes:
- Builds scheduler kernel halves and the kernel-only TWB scheduler under the kernel tree.
- Updates platform, architecture, tool, and test paths; integrates split IPC kernel sources.
- Removes obsolete DMA-trace configuration and hooks, and updates partition documentation.
This pull request requires changes. One unresolved moderate issue remains (3 votes): at src/kernel/platform/mtk/tools/build.sh:16, the four-parent traversal initializes SOF to src rather than the repository root when run as documented. Traverse five parents to correct the generated source and include paths.
| File | Description |
|---|---|
zephyr/include/sof/trace/trace.h |
Removes obsolete DMA-trace commentary. |
zephyr/include/sof/trace/preproc.h |
Removes legacy trace configuration rejection. |
zephyr/include/rtos/sof.h |
Removes legacy trace context fields. |
tools/tplg_parser/CMakeLists.txt |
Updates relocated host include paths. |
tools/testbench/README.md |
Updates the configuration patch example. |
tools/testbench/CMakeLists.txt |
Uses relocated configuration and headers. |
test/ztest/unit/objpool/CMakeLists.txt |
Updates POSIX include path. |
test/ztest/unit/math/matrix/CMakeLists.txt |
Updates POSIX include path. |
test/ztest/unit/math/fft/CMakeLists.txt |
Updates headers and links kernel IPC half. |
test/ztest/unit/math/fft_multi/CMakeLists.txt |
Updates POSIX include path. |
test/ztest/unit/math/dct/CMakeLists.txt |
Updates POSIX include path. |
test/ztest/unit/math/auditory/CMakeLists.txt |
Updates POSIX include path. |
test/ztest/unit/math/advanced/functions/CMakeLists.txt |
Updates POSIX include path. |
test/ztest/unit/fast-get/CMakeLists.txt |
Updates POSIX include path. |
test/ztest/unit/dsrc/CMakeLists.txt |
Updates POSIX include path. |
test/ztest/unit/audio/drc/CMakeLists.txt |
Updates headers and links kernel IPC half. |
test/ztest/unit/audio/crossover/CMakeLists.txt |
Updates POSIX include path. |
test/cmocka/src/math/fft/CMakeLists.txt |
Links kernel IPC half. |
test/cmocka/src/lib/fast-get/CMakeLists.txt |
Uses relocated platform memory source. |
test/cmocka/src/lib/alloc/CMakeLists.txt |
Updates platform source and headers. |
test/cmocka/src/common_mocks.c |
Removes legacy trace mocks. |
test/cmocka/src/audio/volume/CMakeLists.txt |
Links kernel IPC half. |
test/cmocka/src/audio/selector/CMakeLists.txt |
Links kernel IPC half. |
test/cmocka/src/audio/pipeline/CMakeLists.txt |
Links kernel IPC half across tests. |
test/cmocka/src/audio/pcm_converter/CMakeLists.txt |
Links kernel IPC half. |
test/cmocka/src/audio/mixer/CMakeLists.txt |
Links kernel IPC half. |
test/cmocka/src/audio/eq_iir/CMakeLists.txt |
Links kernel IPC half. |
test/cmocka/src/audio/eq_fir/CMakeLists.txt |
Links kernel IPC half. |
test/cmocka/src/audio/dcblock/CMakeLists.txt |
Links kernel IPC half. |
test/cmocka/src/audio/component/CMakeLists.txt |
Links kernel IPC half. |
test/cmocka/src/audio/buffer/CMakeLists.txt |
Links kernel IPC half across tests. |
test/cmocka/configs/rembrandt_defconfig |
Removes legacy trace-channel setting. |
test/cmocka/configs/acp_7_x_defconfig |
Removes legacy trace-channel setting. |
test/cmocka/configs/acp_7_0_defconfig |
Removes legacy trace-channel setting. |
test/cmocka/CMakeLists.txt |
Updates Intel platform include paths. |
src/trace/CMakeLists.txt |
Deletes legacy trace build wiring. |
src/schedule/README.md |
Documents scheduler kernel/user split. |
src/schedule/CMakeLists.txt |
Removes kernel-only TWB source. |
src/kernel/schedule/CMakeLists.txt |
Builds scheduler kernel halves and TWB. |
src/kernel/platform/tigerlake/include/platform/trace/trace.h |
Relocates platform trace header. |
src/kernel/platform/tigerlake/include/platform/platform.h |
Relocates platform definitions. |
src/kernel/platform/tigerlake/include/platform/lib/memory.h |
Removes conditional legacy trace allocation. |
src/kernel/platform/tigerlake/include/platform/lib/mailbox.h |
Relocates mailbox header. |
src/kernel/platform/README.md |
Updates location and documentation link. |
src/kernel/platform/qemu_xtensa/platform.c |
Relocates platform stubs. |
src/kernel/platform/qemu_xtensa/include/platform/trace/trace.h |
Relocates trace stub header. |
src/kernel/platform/qemu_xtensa/include/platform/platform.h |
Relocates platform stub definitions. |
src/kernel/platform/qemu_xtensa/include/platform/lib/memory.h |
Relocates memory stub header. |
src/kernel/platform/qemu_xtensa/include/platform/lib/mailbox.h |
Relocates mailbox stubs. |
src/kernel/platform/qemu_xtensa/include/platform/lib/dma.h |
Relocates DMA definitions. |
src/kernel/platform/qemu_xtensa/include/platform/lib/dai.h |
Relocates DAI stub header. |
src/kernel/platform/qemu_xtensa/include/platform/lib/clk.h |
Relocates clock definitions. |
src/kernel/platform/posix/include/platform/trace/trace.h |
Relocates trace stub header. |
src/kernel/platform/posix/include/platform/platform.h |
Relocates platform definitions. |
src/kernel/platform/posix/include/platform/lib/pm_runtime.h |
Relocates runtime-PM stubs. |
src/kernel/platform/posix/include/platform/lib/memory.h |
Relocates mailbox backing definitions. |
src/kernel/platform/posix/include/platform/lib/mailbox.h |
Relocates mailbox stubs. |
src/kernel/platform/posix/include/platform/lib/dma.h |
Relocates DMA definitions. |
src/kernel/platform/posix/include/platform/lib/dai.h |
Relocates DAI definitions. |
src/kernel/platform/posix/include/platform/lib/cpu.h |
Relocates CPU declarations. |
src/kernel/platform/posix/include/platform/lib/clk.h |
Relocates clock declarations. |
src/kernel/platform/posix/include/platform/fuzz.h |
Relocates fuzz-state API. |
src/kernel/platform/posix/include/platform/drivers/interrupt.h |
Relocates interrupt definitions. |
src/kernel/platform/posix/include/platform/drivers/idc.h |
Relocates IDC stub. |
src/kernel/platform/novalake/lib/clk.c |
Relocates CPU frequency table. |
src/kernel/platform/novalake/include/platform/trace/trace.h |
Relocates trace header. |
src/kernel/platform/novalake/include/platform/platform.h |
Relocates platform definitions. |
src/kernel/platform/novalake/include/platform/lib/mailbox.h |
Relocates mailbox header. |
src/kernel/platform/novalake/include/platform/lib/clk.h |
Relocates clock definitions. |
src/kernel/platform/mtk/tools/README.txt |
Relocates generator instructions. |
src/kernel/platform/mtk/tools/build.sh |
Updates generator paths; root traversal needs correction. |
src/kernel/platform/mtk/include/platform/trace/trace.h |
Relocates trace stub header. |
src/kernel/platform/mtk/include/platform/platform.h |
Relocates platform definitions. |
src/kernel/platform/mtk/include/platform/lib/pm_runtime.h |
Relocates runtime-PM stubs. |
src/kernel/platform/mtk/include/platform/lib/mailbox.h |
Relocates mailbox definitions. |
src/kernel/platform/mtk/include/platform/lib/dma.h |
Relocates DMA definitions. |
src/kernel/platform/mtk/include/platform/lib/dai.h |
Relocates DAI stub header. |
src/kernel/platform/mtk/include/platform/lib/cpu.h |
Relocates CPU definitions. |
src/kernel/platform/mtk/include/platform/lib/clk.h |
Relocates clock definitions. |
src/kernel/platform/meteorlake/lib/clk.c |
Relocates CPU frequency table. |
src/kernel/platform/meteorlake/include/platform/trace/trace.h |
Relocates trace header. |
src/kernel/platform/meteorlake/include/platform/platform.h |
Relocates platform definitions. |
src/kernel/platform/meteorlake/include/platform/lib/mailbox.h |
Relocates mailbox header. |
src/kernel/platform/meteorlake/include/platform/lib/clk.h |
Relocates clock definitions. |
src/kernel/platform/lunarlake/lib/clk.c |
Relocates CPU frequency table. |
src/kernel/platform/lunarlake/include/platform/trace/trace.h |
Relocates trace header. |
src/kernel/platform/lunarlake/include/platform/platform.h |
Relocates platform definitions. |
src/kernel/platform/lunarlake/include/platform/lib/mailbox.h |
Relocates mailbox header. |
src/kernel/platform/lunarlake/include/platform/lib/clk.h |
Relocates clock definitions. |
src/kernel/platform/library/schedule/CMakeLists.txt |
Relocates host scheduler build wiring. |
src/kernel/platform/library/platform.c |
Relocates host platform initialization. |
src/kernel/platform/library/panic.c |
Relocates host panic implementation. |
src/kernel/platform/library/lib/trace.c |
Removes DMA-trace include. |
src/kernel/platform/library/lib/pm_runtime.c |
Relocates runtime-PM stubs. |
src/kernel/platform/library/lib/dai.c |
Relocates host DAI initialization. |
src/kernel/platform/library/lib/CMakeLists.txt |
Builds host trace support unconditionally. |
src/kernel/platform/library/lib/clk.c |
Relocates clock stubs. |
src/kernel/platform/library/lib/alloc.c |
Relocates host allocation wrappers. |
src/kernel/platform/library/init.c |
Relocates host firmware context. |
src/kernel/platform/library/include/platform/lib/ll_schedule.h |
Relocates host LL scheduler API. |
src/kernel/platform/library/include/platform/lib/dma.h |
Relocates DMA definitions. |
src/kernel/platform/library/include/platform/lib/dai.h |
Relocates DAI definitions. |
src/kernel/platform/library/include/platform/lib/cpu.h |
Relocates CPU definitions. |
src/kernel/platform/library/include/platform/lib/clk.h |
Relocates clock definitions. |
src/kernel/platform/library/include/platform/drivers/pmc.h |
Relocates PMC declarations. |
src/kernel/platform/library/include/platform/drivers/idc.h |
Relocates IDC stubs. |
src/kernel/platform/library/CMakeLists.txt |
Relocates host platform build wiring. |
src/kernel/platform/intel/cavs/include/cavs/version.h |
Relocates hardware version definitions. |
src/kernel/platform/intel/cavs/include/cavs/trace/trace.h |
Relocates platform trace implementation. |
src/kernel/platform/intel/cavs/include/cavs/mem_window.h |
Relocates memory-window API. |
src/kernel/platform/intel/cavs/include/cavs/lib/power_down.h |
Relocates power-down API. |
src/kernel/platform/intel/cavs/include/cavs/ext_manifest.h |
Relocates manifest definitions. |
src/kernel/platform/intel/cavs/include/cavs/drivers/timestamp.h |
Relocates timestamp register definitions. |
src/kernel/platform/intel/cavs/include/cavs/drivers/sideband-ipc.h |
Relocates IPC register definitions. |
src/kernel/platform/intel/cavs/include/cavs/drivers/mn.h |
Relocates clock-divider definitions. |
src/kernel/platform/intel/ace/include/auth/intel_status_logger_api.h |
Relocates status-logger wrappers. |
src/kernel/platform/intel/ace/include/ace/version.h |
Relocates hardware version definitions. |
src/kernel/platform/intel/ace/include/ace/lib/memory.h |
Relocates shared memory header. |
src/kernel/platform/intel/ace/include/ace/lib/clk.h |
Relocates shared clock declarations. |
src/kernel/platform/imx95/linker/data-sections.ld |
Relocates firmware metadata linker section. |
src/kernel/platform/imx95/lib/clk.c |
Relocates clock initialization. |
src/kernel/platform/imx95/include/platform/trace/trace.h |
Relocates trace stub header. |
src/kernel/platform/imx95/include/platform/platform.h |
Relocates platform definitions. |
src/kernel/platform/imx95/include/platform/lib/memory.h |
Relocates memory definitions. |
src/kernel/platform/imx95/include/platform/lib/mailbox.h |
Relocates mailbox layout. |
src/kernel/platform/imx95/include/platform/lib/dma.h |
Relocates DMA stub header. |
src/kernel/platform/imx95/include/platform/lib/clk.h |
Relocates clock API. |
src/kernel/platform/imx93_a55/lib/clk.c |
Relocates clock initialization. |
src/kernel/platform/imx93_a55/include/platform/trace/trace.h |
Relocates trace stub header. |
src/kernel/platform/imx93_a55/include/platform/platform.h |
Relocates platform definitions. |
src/kernel/platform/imx93_a55/include/platform/lib/memory.h |
Relocates memory definitions. |
src/kernel/platform/imx93_a55/include/platform/lib/dma.h |
Relocates DMA definitions. |
src/kernel/platform/imx93_a55/include/platform/lib/dai.h |
Relocates DAI stub header. |
src/kernel/platform/imx93_a55/include/platform/lib/clk.h |
Relocates clock API. |
src/kernel/platform/imx93_a55/include/platform/drivers/idc.h |
Relocates IDC stub. |
src/kernel/platform/imx8ulp/platform.c |
Removes legacy DMA-trace initialization. |
src/kernel/platform/imx8ulp/lib/clk.c |
Relocates clock initialization. |
src/kernel/platform/imx8ulp/include/platform/trace/trace.h |
Relocates trace stub header. |
src/kernel/platform/imx8ulp/include/platform/lib/dma.h |
Relocates DMA definitions. |
src/kernel/platform/imx8ulp/include/platform/lib/dai.h |
Relocates DAI stub header. |
src/kernel/platform/imx8ulp/include/platform/lib/cpu.h |
Relocates CPU definitions. |
src/kernel/platform/imx8ulp/include/platform/lib/clk.h |
Relocates clock API. |
src/kernel/platform/imx8ulp/include/platform/drivers/interrupt.h |
Relocates interrupt definitions. |
src/kernel/platform/imx8ulp/include/platform/drivers/idc.h |
Relocates IDC stubs. |
src/kernel/platform/imx8ulp/include/arch/xtensa/config/defs.h |
Relocates Xtensa compatibility header. |
src/kernel/platform/imx8m/platform.c |
Removes legacy DMA-trace initialization. |
src/kernel/platform/imx8m/lib/clk.c |
Relocates clock initialization. |
src/kernel/platform/imx8m/include/platform/trace/trace.h |
Relocates trace stub header. |
src/kernel/platform/imx8m/include/platform/lib/pm_runtime.h |
Relocates runtime-PM stubs. |
src/kernel/platform/imx8m/include/platform/lib/dai.h |
Relocates DAI stub header. |
src/kernel/platform/imx8m/include/platform/lib/cpu.h |
Relocates CPU definitions. |
src/kernel/platform/imx8m/include/platform/lib/clk.h |
Relocates clock API. |
src/kernel/platform/imx8m/include/platform/drivers/idc.h |
Relocates IDC stubs. |
src/kernel/platform/imx8m/include/arch/xtensa/config/defs.h |
Relocates Xtensa compatibility header. |
src/kernel/platform/imx8m_cm7/linker/data-sections.ld |
Relocates firmware metadata linker section. |
src/kernel/platform/imx8m_cm7/lib/clk.c |
Relocates clock initialization. |
src/kernel/platform/imx8m_cm7/include/platform/trace/trace.h |
Relocates trace stub header. |
src/kernel/platform/imx8m_cm7/include/platform/platform.h |
Relocates platform definitions. |
src/kernel/platform/imx8m_cm7/include/platform/lib/memory.h |
Relocates memory definitions. |
src/kernel/platform/imx8m_cm7/include/platform/lib/mailbox.h |
Relocates mailbox layout. |
src/kernel/platform/imx8m_cm7/include/platform/lib/dma.h |
Relocates DMA stub header. |
src/kernel/platform/imx8m_cm7/include/platform/lib/clk.h |
Relocates clock API. |
src/kernel/platform/imx8/lib/clk.c |
Relocates clock initialization. |
src/kernel/platform/imx8/include/platform/trace/trace.h |
Relocates trace stub header. |
src/kernel/platform/imx8/include/platform/lib/dma.h |
Relocates DMA definitions. |
src/kernel/platform/imx8/include/platform/lib/dai.h |
Relocates DAI stub header. |
src/kernel/platform/imx8/include/platform/lib/cpu.h |
Relocates CPU definitions. |
src/kernel/platform/imx8/include/platform/lib/clk.h |
Relocates clock API. |
src/kernel/platform/imx8/include/platform/drivers/idc.h |
Relocates IDC stubs. |
src/kernel/platform/imx8/include/arch/xtensa/config/defs.h |
Relocates Xtensa compatibility header. |
src/kernel/platform/CMakeLists.txt |
Builds relocated host platform. |
src/kernel/platform/amd/rembrandt/platform.c |
Removes legacy DMA-trace setup. |
src/kernel/platform/amd/rembrandt/include/arch/xtensa/config/defs.h |
Relocates Xtensa compatibility header. |
src/kernel/platform/amd/common/include/platform/trace/trace.h |
Relocates trace stub header. |
src/kernel/platform/amd/common/include/platform/lib/pm_runtime.h |
Relocates runtime-PM stubs. |
src/kernel/platform/amd/common/include/platform/lib/mailbox.h |
Relocates mailbox definitions. |
src/kernel/platform/amd/common/include/platform/lib/dma.h |
Relocates DMA definitions. |
src/kernel/platform/amd/common/include/platform/lib/cpu.h |
Relocates CPU definitions. |
src/kernel/platform/amd/common/include/platform/lib/clk.h |
Relocates clock API. |
src/kernel/platform/amd/common/include/platform/ipc.h |
Relocates IPC declarations. |
src/kernel/platform/amd/common/include/platform/drivers/idc.h |
Relocates IDC stubs. |
src/kernel/platform/amd/common/include/platform/acp_sp_dma.h |
Relocates serial-port DMA API. |
src/kernel/platform/amd/common/include/platform/acp_dmic_dma.h |
Relocates DMIC DMA API. |
src/kernel/platform/amd/common/include/platform/acp_dma.h |
Relocates DMA structures and API. |
src/kernel/platform/amd/acp_7_x/platform.c |
Removes DMA-trace include. |
src/kernel/platform/amd/acp_7_0/platform.c |
Removes DMA-trace include. |
src/kernel/platform/amd/acp_7_0/include/arch/xtensa/config/defs.h |
Relocates Xtensa compatibility header. |
src/kernel/platform/ace30/lib/clk.c |
Relocates CPU frequency table. |
src/kernel/platform/ace30/include/platform/trace/trace.h |
Relocates trace header. |
src/kernel/platform/ace30/include/platform/platform.h |
Relocates platform definitions. |
src/kernel/platform/ace30/include/platform/lib/mailbox.h |
Relocates mailbox header. |
src/kernel/platform/ace30/include/platform/lib/clk.h |
Relocates clock definitions. |
src/kernel/logging/Kconfig |
Relocates probe logging configuration. |
src/kernel/Kconfig |
Sources relocated logging configuration. |
src/kernel/ipc/ipc4/CMakeLists.txt |
Builds split IPC4 kernel halves. |
src/kernel/ipc/ipc3/helper.c |
Removes legacy trace-message helpers. |
src/kernel/ipc/CMakeLists.txt |
Builds common IPC kernel half. |
src/kernel/init/README.md |
Removes obsolete trace initialization description. |
src/kernel/init/init.c |
Removes legacy trace initialization. |
src/kernel/CMakeLists.txt |
Builds relocated host architecture/platform. |
src/kernel/arch/xtensa/Kconfig |
Relocates Xtensa configuration. |
src/kernel/arch/README.md |
Updates location and documentation link. |
src/kernel/arch/Kconfig |
Relocates architecture configuration dispatch. |
src/kernel/arch/host/lib/notifier.c |
Relocates host notifier context. |
src/kernel/arch/host/lib/CMakeLists.txt |
Relocates host architecture build wiring. |
src/kernel/arch/host/lib/ams.c |
Relocates host AMS context. |
src/kernel/arch/host/include/arch/sof.h |
Relocates architecture context header. |
src/kernel/arch/host/include/arch/schedule/task.h |
Relocates task compatibility header. |
src/kernel/arch/host/include/arch/lib/wait.h |
Relocates wait stubs. |
src/kernel/arch/host/include/arch/lib/cpu.h |
Relocates CPU stubs. |
src/kernel/arch/host/include/arch/lib/cache.h |
Relocates cache stubs. |
src/kernel/arch/host/include/arch/drivers/timer.h |
Relocates timer stubs. |
src/kernel/arch/host/include/arch/drivers/interrupt.h |
Relocates interrupt stubs. |
src/kernel/arch/host/include/arch/drivers/idc.h |
Relocates IDC compatibility header. |
src/kernel/arch/host/include/arch/debug/panic.h |
Relocates panic stub. |
src/kernel/arch/host/include/arch/debug/backtrace.h |
Relocates host backtrace implementation. |
src/kernel/arch/host/include/arch/compiler_info.h |
Relocates compiler metadata definitions. |
src/kernel/arch/host/configs/library_defconfig |
Removes verbose legacy trace setting. |
src/kernel/arch/host/CMakeLists.txt |
Updates public host include paths. |
src/kernel/arch/CMakeLists.txt |
Builds relocated architecture directory. |
src/Kconfig |
Updates kernel paths and removes trace configuration. |
src/ipc/README.md |
Updates platform driver location. |
src/ipc/ipc4/README.md |
Documents split kernel message routers. |
src/ipc/CMakeLists.txt |
Removes trace-only DMA-copy build wiring. |
src/include/sof/schedule/schedule.h |
Shares scheduler classification inline helper. |
src/include/sof/ipc/topology.h |
Declares shared IPC4 helpers. |
src/include/sof/ipc/msg.h |
Removes legacy trace-message declarations. |
src/include/sof/ipc/common.h |
Shares user IPC entry/events; removes trace API. |
src/include/sof/debug/debug.h |
Removes legacy hexadecimal trace macros. |
src/debug/panic.c |
Removes legacy trace flushing. |
src/CMakeLists.txt |
Routes host architecture/platform through kernel tree. |
src/audio/README.md |
Updates kernel-only platform path. |
src/audio/module_adapter/module/waves/waves.c |
Removes legacy verbose trace dumps. |
src/audio/Kconfig |
Removes legacy trace-channel option. |
scripts/rebuild-testbench.sh |
Updates documented permanent configuration path. |
scripts/kernel_user_partition.txt |
Updates platform classification and removes trace header. |
scripts/cmake/kconfig.cmake |
Updates host configuration search paths. |
scripts/cmake/defconfigs.cmake |
Discovers relocated architecture configurations. |
posix/include/rtos/sof.h |
Removes legacy trace context fields. |
doc/sof.doxygen.in |
Removes legacy trace preprocessing definition. |
CODEOWNERS |
Updates platform ownership paths. |
CMakeLists.txt |
Uses relocated host architecture for tests. |
app/prj.conf |
Removes obsolete trace setting. |
app/CMakeLists.txt |
Uses relocated Xtensa include path. |
app/boards/intel_adsp_ace40_nvls.conf |
Removes obsolete trace setting. |
app/boards/intel_adsp_ace40_nvl.conf |
Removes obsolete trace setting. |
app/boards/imx8mp_evk_mimx8ml8_adsp.conf |
Removes obsolete trace setting. |
app/boards/acp_7_x_adsp.conf |
Removes obsolete trace setting. |
app/boards/acp_7_0_adsp.conf |
Removes obsolete trace setting. |
AGENTS.md |
Updates kernel-directory tier guidance. |
Review effort: Balanced
| @@ -13,11 +13,11 @@ SOF=`cd ../../../..; /bin/pwd` | |||
|
|
|||
| for p in $PLATFORMS; do | |||
|
|
|||
| SRCS="$SOF/src/platform/$p/lib/dai.c $SOF/src/platform/$p/afe-platform.c" | |||
| SRCS="$SOF/src/kernel/platform/$p/lib/dai.c $SOF/src/kernel/platform/$p/afe-platform.c" | |||

Phase 3 of #11306 (kernel / user-space partition), second part: split the scheduler sources and move their kernel parts into
src/kernel/schedule. Stacked on #11422; only the last nine commits are new.As in the first part, the kernel half of
src/X/foo.cissrc/kernel/X/foo-kernel.c, and each user half says where its kernel half is.What counts as kernel:
z_impl_/z_vrfy_halves of the scheduler syscalls.What stays in
src/schedule: what runs in the scheduler, DP and IPC threads, which are user threads with user-space LL:Patches
zephyr_domain.c→zephyr_domain-kernel.c:zephyr_domain_init().ll_sch_is_current().sof/schedule/zephyr_ll.h.zephyr_ll.c→zephyr_ll-kernel.c: the kernel half getszephyr_ll_scheduler_init()and the ops;zephyr_ll_task_sem_alloc()/_free()syscalls;zephyr_ll_init_context()anduser_ll_grant_access().The scheduler structures and the per-core lock table go into
sof/schedule/zephyr_ll.h.Move the DP scheduler's private header to
sof/schedule/zephyr_dp_schedule.h, so that the kernel halves can include it, and give it an include guard.zephyr_dp_schedule.c→zephyr_dp_schedule-kernel.c: the kernel half getsscheduler_dp_grant();scheduler_dp_ll_tick()syscall;scheduler_dp_init()with the ops, UUID, trace context and log module.zephyr_dp_schedule_thread.c→zephyr_dp_schedule_thread-kernel.c: the kernel half getsscheduler_dp_task_init()(thread, stack, event, pinning, grants, memory domain) and thescheduler_dp_internal_free()syscall.zephyr_dp_schedule_application.c→zephyr_dp_schedule_application-kernel.c:scheduler_dp_task_init();scheduler_dp_internal_free()syscall and its caller checks;Move the TWB scheduler to
src/kernel/schedule. It isn't split because it is kernel-only:irq_lock(), in its thread function too;schedule.c→schedule-kernel.c:scheduler_init()andscheduler_register().scheduler_is_user()becomes a static inline insof/schedule/schedule.h.Docs: the scheduler README and the syscall table of the user-space README.
The DP thread variant still creates kernel-mode DP threads when the module isn't a user-space module. That is a configuration choice and is unchanged. Some user-half code still calls kernel functions, for example
user_stack_free()andk_thread_abort()in DP task free. The issue tracks those in Phase 5.Functional change
None. The per-function disassembly of every image was compared before and after each commit. It differs only where the compiler inlines differently across the split:
zephyr_ll.c(builds with user-space support):zephyr_ll_task_done()now inlines a log message's syscall wrapper instead of calling a local out-of-line copy. The register allocation ofzephyr_ll_task_free()andzephyr_ll_task_init()differs.zephyr_dp_schedule.c:z_impl_scheduler_dp_ll_tick()calls the lock helpers instead of inlining them. In the application variant,scheduler_dp_task_free()callsscheduler_dp_task_stop()instead of inlining it.sof_init(), which embeds the git hash.Symbols are unchanged apart from the functions and objects that are now shared between the halves becoming global. The
SYS_INIT()order, every build's.configand the generated rimage configurations are unchanged.Testing
Builds: tgl, tgl-h, mtl, lnl, ptl, wcl, nvl, imx8, imx8x, imx8m, imx8m_cm7, imx8ulp, imx95 and qemu_xtensa, and the extra CI configurations:
CONFIG_SOF_USERSPACE_PROXY=n;os_linux_overlay.conf;llext_relocatable.conf.MTL builds the TWB scheduler.
Comparisons: objects, LLEXT modules and firmware images (sections, symbols,
SYS_INIT()order), plus the per-function disassembly comparison above.Signing: rimage runs for every Intel platform, and the generated configs are unchanged.
Cadence xt-clang (RI-2022.10): MTL, PTL and NVL compile.
ZTest: the unit tests pass, run as in CI (18 of 18 configurations).
Host: the host library and the cmocka unit tests build and pass for all nine defconfigs and the library config.
sof-hda-generic-cavs25-2ch.tplg, comparing the tip of Phase 3 (part 1): split the mixed IPC files, kernel halves to src/kernel/ipc #11422 and this branch. That covers the LL scheduler, its timer domain, scheduler registration and the DP scheduler init. Both boot, play 5 s, and play again after runtime suspend, with no DSP errors. No ACE hardware was available, so the user-space LL and DP application paths were only build-tested.🤖 Generated with Claude Code