-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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_NXATOMIC #14681
base: master
Are you sure you want to change the base?
arch_atomic : Introduce CONFIG_LIBC_ARCH_NXATOMIC #14681
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_NXATOMIC 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. Signed-off-by: Takuya Miyasita <[email protected]>
[Experimental Bot, please feedback here] No, this PR does not fully meet the NuttX requirements. Here's why and how to fix it: Missing Information/Improvements Needed:
Example of Improved Impact Section:
By addressing these points, your PR will be much stronger and easier for reviewers to evaluate. Remember, clarity and thoroughness are key to a successful contribution! |
please refer following comment. |
Sorry I have to cancel the CI Check, there's a problem with CI Test: |
#define atomic_fetch_sub_explicit(obj, val, type) atomic_fetch_sub_n(obj, val, type) | ||
|
||
#else | ||
|
||
#define atomic_store_n(obj, val, type) \ | ||
(sizeof(*(obj)) == 1 ? __atomic_store_1(obj, val, type) : \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's always map to to nx_ version regardless CONFIG_LIBC_ARCH_NXATOMIC
#ifdef CONFIG_LIBC_ARCH_NXATOMIC | ||
|
||
#define atomic_store_n(obj, val, type) \ | ||
(sizeof(*(obj)) == 1 ? __nx_atomic_store_1(obj, val, type) : \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chang ALL __nx_
to nx_
Summary
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_NXATOMIC 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.
Impact
CONFIG_ARCH_CHIP_CXD32XX.
Testing
About ARCH_CHIP_CXD32XX, the build is passed and ostes is passed, but the board is out-of-tree.
About raspberrypi-pico:nsh, the build is passed. (not executed)
About spresense:smp, the build is passed. (not executed)
tool-chain version:
and