[rtems commit] smp: Move secondary CPU initialization request

Sebastian Huber sebh at rtems.org
Wed May 29 09:04:03 UTC 2013


Module:    rtems
Branch:    master
Commit:    e071c18322b9e01f95fced40fe0242542e1b13e1
Changeset: http://git.rtems.org/rtems/commit/?id=e071c18322b9e01f95fced40fe0242542e1b13e1

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu May 16 11:08:40 2013 +0200

smp: Move secondary CPU initialization request

Do not assume that the scheduler selects the main processor for the
initialization thread.

---

 cpukit/sapi/src/exinit.c         |    4 ++++
 cpukit/score/src/threadhandler.c |    6 ------
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c
index 3fb27fd..4ee2471 100644
--- a/cpukit/sapi/src/exinit.c
+++ b/cpukit/sapi/src/exinit.c
@@ -223,6 +223,10 @@ void rtems_initialize_start_multitasking(void)
 
   _System_state_Set( SYSTEM_STATE_BEGIN_MULTITASKING );
 
+#ifdef RTEMS_SMP
+  _SMP_Request_other_cores_to_perform_first_context_switch();
+#endif
+
   _Thread_Start_multitasking();
 
   /*******************************************************************
diff --git a/cpukit/score/src/threadhandler.c b/cpukit/score/src/threadhandler.c
index 6367c45..e4f124c 100644
--- a/cpukit/score/src/threadhandler.c
+++ b/cpukit/score/src/threadhandler.c
@@ -126,12 +126,6 @@ void _Thread_Handler( void )
      */
     if (doCons) /* && (volatile void *)_init) */ {
       INIT_NAME ();
-   
-      #if defined(RTEMS_SMP)
-        _Thread_Disable_dispatch();
-          _SMP_Request_other_cores_to_perform_first_context_switch();
-        _Thread_Enable_dispatch();
-      #endif
     }
  #endif
 




More information about the vc mailing list