arch_atomic : Introduce CONFIG_LIBC_ARCH_ATOMIC

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>
This commit is contained in:
Takuya Miyasita
2024-11-06 13:26:49 +09:00
committed by Xiang Xiao
parent 07c986905d
commit 2275138dcf
6 changed files with 482 additions and 388 deletions
+8
View File
@@ -9,6 +9,14 @@
menu "Architecture-Specific Support"
config LIBC_ARCH_ATOMIC
bool "arch_atomic"
default n
---help---
If this configuration is selected and <include/nuttx/atomic.h> is
included, arch_atomic.c will be linked instead of built-in
atomic function.
config ARCH_LOWPUTC
bool "Low-level console output"
default y
File diff suppressed because it is too large Load Diff