mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
sched: Define CONFIG_SMP_NCPUS to 1 in no SMP case
to simplify the SMP related code logic Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
@@ -39,11 +39,7 @@
|
||||
* CURRENT_REGS for portability.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
uint32_t *volatile g_current_regs[CONFIG_SMP_NCPUS];
|
||||
#else
|
||||
uint32_t *volatile g_current_regs[1];
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
# include <nuttx/arch.h>
|
||||
# include <sys/types.h>
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
@@ -110,22 +111,12 @@ extern "C"
|
||||
* CURRENT_REGS for portability.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/* For the case of architectures with multiple CPUs, then there must be one
|
||||
* such value for each processor that can receive an interrupt.
|
||||
*/
|
||||
|
||||
int up_cpu_index(void); /* See include/nuttx/arch.h */
|
||||
|
||||
EXTERN uint32_t *volatile g_current_regs[CONFIG_SMP_NCPUS];
|
||||
# define CURRENT_REGS (g_current_regs[up_cpu_index()])
|
||||
|
||||
#else
|
||||
|
||||
EXTERN uint32_t *volatile g_current_regs[1];
|
||||
# define CURRENT_REGS (g_current_regs[0])
|
||||
|
||||
#endif
|
||||
#define CURRENT_REGS (g_current_regs[up_cpu_index()])
|
||||
|
||||
/* This is the beginning of heap as provided from up_head.S.
|
||||
* This is the first address in DRAM after the loaded
|
||||
|
||||
Reference in New Issue
Block a user