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

   
   
   ## Summary
   This PR refactors the CPU index handling in the RISC-V architecture to be 
based on the ARCH_RV_HARTID_BASE configuration. 
   
   The changes include:                                 
                                                                                
                                                                                
                   
    1. **Kconfig Updates:**                                                     
                                                                                
                   
       - Rewrote the help text for ARCH_RV_HARTID_BASE                          
                                                                                
                   
       - Added detailed explanations covering:                                  
                                                                                
                   
         * Purpose (mapping global hartid to cluster-local id)                  
                                                                                
                   
         * Examples (hartid ranges for different clusters)                      
                                                                                
                   
         * Key points (SMP_NCPUS, consecutive id requirements)                  
                                                                                
                   
         * Special cases (K230 chip, etc.)                                      
                                                                                
                   
                                                                                
                                                                                
                   
    2. **Header File Changes:**                                                 
                                                                                
                   
       - Modified up_cpu_index() condition from CONFIG_RISCV_PERCPU_SCRATCH to 
CONFIG_ARCH_RV_HARTID_BASE != 0 in irq.h                                        
                    
                                                                                
                                                                                
                   
    3. **Build System Updates:**                                                
                                                                                
                   
       - Changed compilation condition for riscv_cpuindex.c from 
CONFIG_ARCH_HAVE_MULTICPU to CONFIG_ARCH_RV_HARTID_BASE != 0 in both 
CMakeLists.txt and Make.defs                 
                                                                                
                                                                                
                   
    4. **Source Code Refactoring:**                                             
                                                                                
                   
       - Removed CONFIG_RISCV_PERCPU_SCRATCH conditional compilation in 
riscv_cpuindex.c                                                                
                           
       - Added CONFIG_ARCH_RV_HARTID_BASE != 0 conditional compilation in 
riscv_internal.h                                                                
                         
       - Defined simple hartid/cpuid conversion macros when 
CONFIG_ARCH_RV_HARTID_BASE is 0                                                 
                                       
                                                                                
                                                                                
                   
    These changes aim to make the CPU index handling more consistent and clear, 
using ARCH_RV_HARTID_BASE as the primary configuration for managing hartid 
mappings in multi-clust 
    systems.                          
                       
   ## Impact
   
   RISCV SMP
   
   ## Testing
   GitHub CI and QEMU
   
   
   


-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to