-
Notifications
You must be signed in to change notification settings - Fork 1.5k
arch_atomic : Introduce CONFIG_LIBC_ARCH_ATOMIC #14803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arch_atomic : Introduce CONFIG_LIBC_ARCH_ATOMIC #14803
Conversation
Some armv7-m-based SoCs do not work with atomic instructions, even though armv7-m supports them. To avoid using atomic instructions generated by gcc, CONFIG_LIBC_ARCH_ATOMIC is newly introduced with which arch_atomic.c is linked explicitly. However, the function names need to be changed to avoid build errors, since the functions described in stdatomic.h are gcc built-in and inlined when the code is compiled. About libcxx with CONFIG_LIBC_ARCH_ATOMIC, it still does not work. It is also needed to call nx_atomic_ ver instead of __atomic ver in libcxx/include/__atomic/cxx_atomic_lmpl.h. Signed-off-by: Takuya Miyasita <Takuya.Miyashita@sony.com>
|
[Experimental Bot, please feedback here] The PR summary provided is insufficient and lacks crucial information required by the NuttX guidelines. Here's a breakdown of the issues and a suggested improvement: Missing/Insufficient Information:
Suggested Improved Summary: SummaryThis PR addresses an issue where atomic instructions fail on certain ARMv7-M SoCs (specifically, family X, model Y, etc. - list affected SoCs), despite being architecturally supported. This failure manifests as [describe the specific symptoms of the failure, e.g., data corruption, system crashes, etc.]. The root cause is [explain the root cause - silicon errata, compiler bug, etc.]. To resolve this, a new Kconfig option Fixes [NuttX Issue # if applicable]. Impact
TestingI confirm that changes are verified on a local setup and work as intended. The intended outcome was to enable correct operation of atomic instructions on the affected platforms by utilizing software emulation. The following tests were performed:
Testing Logs (Before Change - ARCH_CHIP_CXD32XX): Testing Logs (After Change - ARCH_CHIP_CXD32XX): ...(Repeat log examples for other tested platforms, showing the problem before and the solution after). By providing more detail and clarity, the PR will be much easier for reviewers to understand and approve. Remember to always provide specific information and demonstrate the problem and solution with concrete examples. |
|
@tmedicci @masayuki2009 please verify this patch. |
Summary
Some armv7-m-based SoCs do not work with atomic instructions, even though armv7-m supports them.
(About these SoC, please refer 4cec713#commitcomment-148460811)
To avoid using atomic instructions generated by gcc, CONFIG_LIBC_ARCH_ATOMIC is newly introduced with which arch_atomic.c is linked explicitly.
However, the function names need to be changed to avoid build errors, since the functions described in stdatomic.h are gcc built-in and inlined when the code is compiled.
About libcxx with CONFIG_LIBC_ARCH_ATOMIC, it still does not work. It is also needed to call nx_atomic_ ver instead of __atomic ver in libcxx/include/__atomic/cxx_atomic_lmpl.h.
Impact
ARCH_CHIP_CXD32XX
Testing
tool-chain version