1
0
Эх сурвалжийг харах

!556 修复非SMP环境下不存在CPU_NRS导致的错误
Merge pull request !556 from PolarLush/aarch64-smp-cpu

bernard 3 жил өмнө
parent
commit
4909de4096

+ 5 - 2
libcpu/aarch64/common/cpu.h

@@ -13,6 +13,7 @@
 #include <rtthread.h>
 #include <stdbool.h>
 
+#ifdef RT_USING_SMP
 struct cpu_ops_t
 {
     const char *method;
@@ -39,8 +40,6 @@ extern struct dtb_node *_cpu_node[];
 #define set_cpu_node(cpuid, node) \
     ((((cpuid) >= 0) && ((cpuid) < RT_CPUS_NR)) ? (_cpu_node[cpuid] = node) : NULL)
 
-extern void rt_hw_cpu_shutdown(void);
-
 extern int rt_hw_cpu_init();
 
 extern int rt_hw_cpu_boot_secondary(int num_cpus, rt_uint64_t *cpu_hw_ids, struct cpu_ops_t *cpu_ops[]);
@@ -51,4 +50,8 @@ extern struct cpu_ops_t cpu_ops_psci;
 
 extern struct cpu_ops_t cpu_ops_spin_tbl;
 
+#endif /* RT_USING_SMP */
+
+extern void rt_hw_cpu_shutdown(void);
+
 #endif /* __RT_HW_CPU_H__ */

+ 4 - 0
libcpu/aarch64/common/cpu_psci.c

@@ -10,6 +10,8 @@
 #include <rtthread.h>
 #include <stdint.h>
 
+#ifdef RT_USING_SMP
+
 #define DBG_TAG "libcpu.aarch64.cpu_psci"
 #define DBG_LVL DBG_INFO
 #include <rtdbg.h>
@@ -59,3 +61,5 @@ struct cpu_ops_t cpu_ops_psci = {
     .cpu_init = cpu_psci_cpu_init,
     .cpu_shutdown = RT_NULL
 };
+
+#endif /* RT_USING_SMP */

+ 3 - 0
libcpu/aarch64/common/cpu_spin_table.c

@@ -16,6 +16,7 @@
 #include <rtdbg.h>
 #include "cpu_ops_common.h"
 
+#ifdef RT_USING_SMP
 #ifdef RT_USING_FDT
 #include <dtb_node.h>
 
@@ -65,3 +66,5 @@ struct cpu_ops_t cpu_ops_spin_tbl = {
     .cpu_boot = spin_table_cpu_boot,
 #endif
 };
+
+#endif /* RT_USING_SMP */