arch/tricore: drop illd dependence for atomic - #19953
Open
zhangyu-duck wants to merge 2 commits into
Open
Conversation
Replace ILLD intrinsics (__swap, __ld32, __cmpAndSwap) with inline assembly functions (tricore_atomic_swap, tricore_atomic_cmpswap) to remove the dependency on IfxCpu_Intrinsics.h. Also fix the expect parameter type to use volatile void * to match the declaration in atomic.h, avoiding type conflicts. Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
Select LIBC_ATOMIC_ARCH for TriCore when not using Tasking toolchain, so that the tricore arch-atomic implementation is used instead of the toolchain builtin. Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
zhangyu-duck
marked this pull request as ready for review
August 24, 2026 14:12
xiaoxiang781216
approved these changes
Aug 24, 2026
|
acassis
approved these changes
Aug 24, 2026
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.
Summary
This PR removes the TriCore atomic implementation's dependency on ILLD intrinsics and switches to the NuttX arch-atomic backend.
Patch 1: arch/tricore: drop illd dependence for atomic
__swap,__ld32,__cmpAndSwap) with inline assembly functions (tricore_atomic_swap,tricore_atomic_cmpswap) inlibs/libc/machine/tricore/arch_atomic.c#include <IfxCpu_Intrinsics.h>dependencyexpectparameter type tovolatile void *to match the declaration inatomic.hPatch 2: arch/tricore: use tricore arch-atomic-instruction version
LIBC_ATOMIC_ARCHfor TriCore when not using Tasking toolchain, so that the tricore arch-atomic implementation is used instead of the toolchain builtinTesting
Tested with TC4 (TC4da) build with GCC toolchain.