extinguish opened a new pull request, #14963:
URL: https://github.com/apache/nuttx/pull/14963

   ## Summary
   
   The `up_testset` implementation is common code, should not add custom board 
check.
   If there are new boards that need to use their own up_testset() 
implementation, for example, CONFIG_ARCH_CHIP_1XXX, has provided thier own 
up_testset() implementation, in order to working with CONFIG_ARCH_CHIP_1XXX,
   we need to change the implemetaton to:
   ```
   #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_1XXX)
   static inline_function spinlock_t up_testset(volatile spinlock_t *lock)
   {
   ```
   
   which would make the macro check becoming longer and longer;
   beside from this, if the board of CONFIG_ARCH_CHIP_1XXX will not upstream to 
github, then this code will also cannot upstream to github;
   
   beside from the upper cause, another reason for introducing a new 
configuration:`CONFIG_ARCH_HAVE_CUSTOM_TESTSET` is that generally a board 
belongs to an architecture. For example, CONFIG_ARCH_CHIP_LC823450 belongs to 
ARMV7_M. Then ARMV7_M itself has `CONFIG_ARCH_HAVE_TESTSET` enabled.
   In this case, all the boards under ARMV7_M have `CONFIG_ARCH_HAVE_TESTSET` 
enabled by default.
   However, `CONFIG_ARCH_CHIP_LC823450` doesn't require 
`CONFIG_ARCH_HAVE_TESTSET`. We can't turn off `CONFIG_ARCH_HAVE_TESTSET `for 
all the boards under the entire `ARMV7_M` just for the sake of this single 
`CONFIG_ARCH_CHIP_LC823450.`
   Therefore, we have introduced a new option called 
`CONFIG_ARCH_HAVE_CUSTOM_TESTSET`.
   
   ## Impact
   
   If some boards need custom `up_testset` implementation, should not to add 
macro control on `arch/arm/include/spinlock.h`, just modify the board config 
inside `arch/arm/Kconfig` will work.
   
   ## Testing
   
   has passed ostest
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to