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:
Xiang Xiao
2022-01-18 23:30:29 +08:00
committed by Xiang Xiao
parent 04297c3ca3
commit 77792a1598
35 changed files with 27 additions and 230 deletions
-4
View File
@@ -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
+2 -11
View File
@@ -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