summaryrefslogtreecommitdiff
path: root/src/components.c
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2018-11-22 22:44:46 +0800
committerGitHub <[email protected]>2018-11-22 22:44:46 +0800
commit6445328accc3570cb4b5d1394765074a29f4385d (patch)
tree9806ccc0627c400a3fab8dcc3b5d8f6e2490268d /src/components.c
parent8cc81af1f651e275b7d812399eafe4bfb4e047e1 (diff)
parent94a2e751a57938c43cba54b5eb1ac00fd3716ed4 (diff)
Merge pull request #1999 from jesven/smp_4.0
Smp 4.0
Diffstat (limited to 'src/components.c')
-rw-r--r--src/components.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/components.c b/src/components.c
index 68e5799f59..d77ef8300f 100644
--- a/src/components.c
+++ b/src/components.c
@@ -14,6 +14,7 @@
* 2015-05-04 Bernard Rename it to components.c because compiling issue
* in some IDEs.
* 2015-07-29 Arda.Fu Add support to use RT_USING_USER_MAIN with IAR
+ * 2018-11-22 Jesven Add secondary cpu boot up
*/
#include <rthw.h>
@@ -180,6 +181,9 @@ void main_thread_entry(void *parameter)
/* RT-Thread components initialization */
rt_components_init();
+#ifdef RT_USING_SMP
+ rt_hw_secondary_cpu_up();
+#endif
/* invoke system main function */
#if defined(__CC_ARM) || defined(__CLANG_ARM)
$Super$$main(); /* for ARMCC. */
@@ -243,6 +247,10 @@ int rtthread_startup(void)
/* idle thread initialization */
rt_thread_idle_init();
+#ifdef RT_USING_SMP
+ rt_hw_spin_lock(&_cpus_lock);
+#endif /*RT_USING_SMP*/
+
/* start scheduler */
rt_system_scheduler_start();