diff --git a/arch/Kconfig b/arch/Kconfig index 3f805ab1ddaca..6954ec35c57fb 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -489,6 +489,10 @@ config ARCH_HAVE_TESTSET bool default n +config ARCH_HAVE_CUSTOM_TESTSET + bool + default n + config ARCH_HAVE_THREAD_LOCAL bool default n diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 51adc49fc8f6d..22f54abbacea3 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -221,6 +221,7 @@ config ARCH_CHIP_LC823450 select ARCH_HAVE_HEAPCHECK select ARCH_HAVE_MULTICPU select ARCH_HAVE_I2CRESET + select ARCH_HAVE_CUSTOM_TESTSET select ARCH_HAVE_CUSTOM_VECTORS ---help--- ON Semiconductor LC823450 architectures (ARM dual Cortex-M3) @@ -344,11 +345,11 @@ config ARCH_CHIP_RP2040 select ARCH_CORTEXM0 select ARCH_HAVE_RAMVECTORS select ARCH_HAVE_MULTICPU - select ARCH_HAVE_TESTSET select ARCH_HAVE_I2CRESET select ARM_HAVE_WFE_SEV select ARCH_HAVE_PWM_MULTICHAN select ARCH_BOARD_COMMON + select ARCH_HAVE_CUSTOM_TESTSET select ARCH_HAVE_CUSTOM_VECTORS ---help--- Raspberry Pi RP2040 architectures (ARM dual Cortex-M0+). @@ -358,9 +359,9 @@ config ARCH_CHIP_RP23XX select ARCH_CORTEXM33 select ARCH_HAVE_RAMVECTORS select ARCH_HAVE_MULTICPU - select ARCH_HAVE_TESTSET select ARCH_HAVE_I2CRESET select ARM_HAVE_WFE_SEV + select ARCH_HAVE_CUSTOM_TESTSET select ARCH_HAVE_PWM_MULTICHAN select ARCH_BOARD_COMMON ---help--- @@ -684,6 +685,7 @@ config ARCH_CHIP_CXD56XX select ARCH_HAVE_SDIO if MMCSD select ARCH_HAVE_MATH_H select ARCH_HAVE_I2CRESET + select ARCH_HAVE_CUSTOM_TESTSET select ARCH_HAVE_CUSTOM_VECTORS select LIBC_ARCH_ATOMIC if SMP ---help--- diff --git a/arch/arm/include/spinlock.h b/arch/arm/include/spinlock.h index 4ced6945de3c3..574579ccf1757 100644 --- a/arch/arm/include/spinlock.h +++ b/arch/arm/include/spinlock.h @@ -114,11 +114,7 @@ typedef uint8_t spinlock_t; * ****************************************************************************/ -#if defined(CONFIG_ARCH_HAVE_TESTSET) \ - && !defined(CONFIG_ARCH_CHIP_LC823450) \ - && !defined(CONFIG_ARCH_CHIP_CXD56XX) \ - && !defined(CONFIG_ARCH_CHIP_RP2040) \ - && !defined(CONFIG_ARCH_CHIP_RP23XX) +#if defined(CONFIG_ARCH_HAVE_TESTSET) && !defined(CONFIG_ARCH_HAVE_CUSTOM_TESTSET) static inline_function spinlock_t up_testset(volatile spinlock_t *lock) { spinlock_t ret = SP_UNLOCKED; diff --git a/include/nuttx/spinlock.h b/include/nuttx/spinlock.h index 31d4becd08a63..5d70f75fa5064 100644 --- a/include/nuttx/spinlock.h +++ b/include/nuttx/spinlock.h @@ -176,7 +176,7 @@ extern volatile uint8_t g_irq_spin_count[CONFIG_SMP_NCPUS]; * ****************************************************************************/ -#if defined(CONFIG_ARCH_HAVE_TESTSET) +#if defined(CONFIG_ARCH_HAVE_TESTSET) || defined(CONFIG_ARCH_HAVE_CUSTOM_TESTSET) spinlock_t up_testset(FAR volatile spinlock_t *lock); #else static inline spinlock_t up_testset(FAR volatile spinlock_t *lock) diff --git a/sched/Kconfig b/sched/Kconfig index 74483c5bf7d83..7c74cc2dad45b 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -365,7 +365,7 @@ config SMP bool "Symmetric Multi-Processing (SMP)" default n depends on ARCH_HAVE_MULTICPU - depends on ARCH_HAVE_TESTSET + depends on ARCH_HAVE_TESTSET || ARCH_HAVE_CUSTOM_TESTSET depends on ARCH_INTERRUPTSTACK != 0 select SPINLOCK select IRQCOUNT