Repository navigation
Conversation
lgirdwood
force-pushed
the
topic/zn-rtos-assert-shared
branch
from
December 3, 2026 12:08
7ad84fe to
b1333f3
Compare
On Zephyr, rtos/panic.h includes <zephyr/kernel.h>, so code that includes it for assert() also gets __ASSERT() and __ASSERT_NO_MSG(). Include the <zephyr/sys/__assert.h> stub from the host rtos/panic.h, so that shared code can switch to the Zephyr macros without new includes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
On Zephyr, assert() is defined as __ASSERT_NO_MSG(). The host builds now have the Zephyr assert macros too, so use __ASSERT_NO_MSG() directly in the audio code. No lines are added or removed, so __LINE__ in verbose asserts 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>
On Zephyr, assert() is defined as __ASSERT_NO_MSG(). The host builds now have the Zephyr assert macros too, so use __ASSERT_NO_MSG() directly in the shared headers. No lines are added or removed, so __LINE__ in verbose asserts 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>
On Zephyr, assert() is defined as __ASSERT_NO_MSG(). The host builds now have the Zephyr assert macros too, so use __ASSERT_NO_MSG() directly in the IPC code. No lines are added or removed, so __LINE__ in verbose asserts 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>
On Zephyr, assert() is defined as __ASSERT_NO_MSG(). The host builds now have the Zephyr assert macros too, so use __ASSERT_NO_MSG() directly in the library, DMA driver and sample code. No lines are added or removed, so __LINE__ in verbose asserts 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>
The coherent API debug check macros still used assert(): the address alias and core checks, and the host versions of the sleep and atomic context checks. Use __ASSERT_NO_MSG() like the rest of the header. The Zephyr and host versions of the context checks stay separate, so that no lines move and __LINE__ in verbose asserts 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>
lgirdwood
force-pushed
the
topic/zn-rtos-assert-shared
branch
from
December 4, 2026 13:08
b1333f3 to
8edd6d5
Compare
Member
Author
|
Intention is that user modules should use posix style assert macros, but kernel modules or code should use native zephyr. Pls check and rework the PR. |
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.
Use
__ASSERT_NO_MSG()instead ofassert()in the shared code. Part of #11517 (step 6). It uses the host<zephyr/sys/__assert.h>stub from #11583.On Zephyr,
rtos/panic.hdefinesassert()as__ASSERT_NO_MSG(). The shared code keptassert()because the host had no Zephyr assert macros.Patches
posix: the hostrtos/panic.hincludes the<zephyr/sys/__assert.h>stub, asrtos/panic.hgets the Zephyr macros through<zephyr/kernel.h>on Zephyr. Shared code can then switch without new includes.audio,include,ipc, andlib, drivers, samples:assert()→__ASSERT_NO_MSG(), one commit per area (162 call sites, scripted). Continuation lines are re-aligned and no lines are added or removed, so__LINE__in verbose asserts does not change.coherent: the debug check macros, which are on#definelines that the script leaves alone. The Zephyr and host versions of the context checks stay separate, so that no lines move.Not in this PR
assert()on purpose: the LLEXTllext-wrap.cshims and the STFT process code include<assert.h>. Converting them would change what they call.src/include/module) and host tools such asmt-dai-gen.c: they are built without the SOF headers.sof_panic(): a separate change.Functional change
None on Zephyr. On the host, these asserts always end in the SOF panic.
assert()did too, unless<assert.h>had been included beforertos/panic.h.Testing
host-testbench.sh) pass all 19 component tests.🤖 Generated with Claude Code