This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 4ca2256a9beefd073082334218057f9a9fdec5b1
Author: zhangyu117 <[email protected]>
AuthorDate: Fri Aug 14 14:42:59 2026 +0800

    nuttx/atomic: select LIBC_ATOMIC_IRQ for archs without atomic support
    
    Select LIBC_ATOMIC_IRQ at the architecture level (ARM7TDMI, ARM926EJS,
    ARMv6M) for chips that do not support atomic operations natively. This
    covers all ARM7TDMI, ARM926EJS, and Cortex-M0 based chips automatically.
    
    Also select LIBC_ATOMIC_IRQ for specific non-ARM architectures (AVR,
    RISC-V, SPARC, Xtensa) that lack atomic instruction support.
    
    Signed-off-by: zhangyu117 <[email protected]>
---
 arch/arm/Kconfig             | 3 +++
 arch/arm/src/s32k1xx/Kconfig | 1 +
 arch/avr/Kconfig             | 4 ++++
 arch/risc-v/Kconfig          | 4 ++++
 arch/sparc/Kconfig           | 2 ++
 arch/xtensa/Kconfig          | 1 +
 6 files changed, 15 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 43997be8249..c0a4f9db05a 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -978,6 +978,7 @@ config ARCH_ARM7TDMI
        default n
        select ARCH_DCACHE
        select ARCH_ICACHE
+       select LIBC_ATOMIC_IRQ
        ---help---
                The Arm7TDMI-S is an excellent workhorse processor capable of a 
wide
                array of applications. Traditionally used in mobile handsets, 
the
@@ -1007,6 +1008,7 @@ config ARCH_ARM926EJS
        select ARCH_ICACHE
        select ARCH_HAVE_MMU
        select ARCH_USE_MMU
+       select LIBC_ATOMIC_IRQ
        ---help---
                Arm926EJ-S is the entry point processor capable of supporting 
full
                Operating Systems including Linux, WindowsCE, and Symbian.
@@ -1062,6 +1064,7 @@ config ARCH_ARMV6M
        bool
        default n
        select ARCH_HAVE_CPUINFO
+       select LIBC_ATOMIC_IRQ
 
 config ARCH_CORTEXM0
        bool
diff --git a/arch/arm/src/s32k1xx/Kconfig b/arch/arm/src/s32k1xx/Kconfig
index b71c5d1412d..496e2877877 100644
--- a/arch/arm/src/s32k1xx/Kconfig
+++ b/arch/arm/src/s32k1xx/Kconfig
@@ -75,6 +75,7 @@ config ARCH_CHIP_S32K11X
        bool
        select ARCH_CORTEXM0
        select S32K1XX_HAVE_FIRC_CMU
+       select LIBC_ATOMIC_IRQ
 
 config ARCH_CHIP_S32K14X
        bool
diff --git a/arch/avr/Kconfig b/arch/avr/Kconfig
index 771274f1c00..e56302d7e90 100644
--- a/arch/avr/Kconfig
+++ b/arch/avr/Kconfig
@@ -13,12 +13,14 @@ config ARCH_CHIP_ATMEGA
        bool "ATMega family"
        select ARCH_FAMILY_AVR
        select MM_SMALL
+       select LIBC_ATOMIC_IRQ
        ---help---
                Atmel ATMega family of 8-bit AVRs.
 
 config ARCH_CHIP_AT90USB
        bool "AT90USB family"
        select ARCH_FAMILY_AVR
+       select LIBC_ATOMIC_IRQ
        select MM_SMALL
        ---help---
                Atmel AT90USB family of 8-bit AVRs.
@@ -35,12 +37,14 @@ config ARCH_CHIP_AVRDX
 config ARCH_CHIP_AT32UC3
        bool "AVR32 AT32UC3* family"
        select ARCH_FAMILY_AVR32
+       select LIBC_ATOMIC_IRQ
        ---help---
                Atmel AT32UC3A/B/C family of 32-bit AVR32s.
 
 config ARCH_CHIP_AVR_CUSTOM
        bool "Custom AVR chip"
        select ARCH_CHIP_CUSTOM
+       select LIBC_ATOMIC_IRQ
        ---help---
                Select this option if there is no directory for the chip under 
arch/avr/src/.
 
diff --git a/arch/risc-v/Kconfig b/arch/risc-v/Kconfig
index 4b8367a8321..9aaf3dd4340 100644
--- a/arch/risc-v/Kconfig
+++ b/arch/risc-v/Kconfig
@@ -113,6 +113,7 @@ config ARCH_CHIP_ESP32C3_LEGACY
        select ARCH_HAVE_RAMFUNCS
        select ONESHOT_COUNT if ONESHOT
        select ONESHOT_FAST_DIVISION if ONESHOT
+       select LIBC_ATOMIC_IRQ
        ---help---
                Espressif ESP32-C3 (RV32IMC). Legacy implementation.
 
@@ -146,6 +147,7 @@ config ARCH_CHIP_ESP32C3
        select ONESHOT_COUNT if ONESHOT
        select ONESHOT_FAST_DIVISION if ONESHOT
        select ARCH_MINIMAL_VECTORTABLE
+       select LIBC_ATOMIC_IRQ
        ---help---
                ESP32-C3 chip with a single RISC-V IMC core, no embedded Flash 
memory
 
@@ -211,6 +213,7 @@ config ARCH_CHIP_ESP32H2
        select ONESHOT_COUNT if ONESHOT
        select ONESHOT_FAST_DIVISION if ONESHOT
        select ARCH_MINIMAL_VECTORTABLE
+       select LIBC_ATOMIC_IRQ
        ---help---
                Espressif ESP32-H2 (RV32IMC).
 
@@ -297,6 +300,7 @@ config ARCH_CHIP_RV32M1
        select ONESHOT_COUNT
        select ONESHOT_FAST_DIVISION
        select ALARM_ARCH
+       select LIBC_ATOMIC_IRQ
        ---help---
                NXP RV32M1 processor (RISC-V Core with PULP extensions).
 
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index d5248a1765c..4f950eee3b2 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -18,6 +18,7 @@ config ARCH_CHIP_BM3803
        select ARCH_HAVE_RAMFUNCS
        select ARCH_HAVE_TICKLESS
        select ARCH_HAVE_SERIAL_TERMIOS
+       select LIBC_ATOMIC_IRQ
        ---help---
                Microchip BM3803 (ARCH_SPARC_V8)
 
@@ -29,6 +30,7 @@ config ARCH_CHIP_BM3823
        select ARCH_VECNOTIRQ
        select ARCH_HAVE_RAMFUNCS
        select ARCH_HAVE_SERIAL_TERMIOS
+       select LIBC_ATOMIC_IRQ
        ---help---
                Microchip BM3823 (ARCH_SPARC_V8)
 
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 5f25569d866..b4ec0f3eedb 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -70,6 +70,7 @@ config ARCH_CHIP_ESP32S2
        select LIBC_ARCH_STRNCPY
        select LIBC_ARCH_STRLEN
        select LIBC_ARCH_STRNLEN
+       select LIBC_ATOMIC_IRQ
        ---help---
                ESP32-S2 is a truly secure, highly integrated, low-power, 2.4 
GHz Wi-Fi
                Microcontroller SoC supporting Wi-Fi HT40 and having 43 GPIOs.

Reply via email to