[rtems commit] score: Wait for per-CPU state changes later

Sebastian Huber sebh at rtems.org
Wed Feb 19 08:52:43 UTC 2014


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Feb 18 13:30:28 2014 +0100

score: Wait for per-CPU state changes later

Wait for per-CPU changes into PER_CPU_STATE_READY_TO_BEGIN_MULTITASKING
later.  There is no need to delay the initialization of the main
processor at this point.

---

 cpukit/score/src/smp.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
index 5e098e6..1353d14 100644
--- a/cpukit/score/src/smp.c
+++ b/cpukit/score/src/smp.c
@@ -46,15 +46,6 @@ void _SMP_Handler_initialize( void )
   max_cpus = _CPU_SMP_Initialize( max_cpus );
 
   _SMP_Processor_count = max_cpus;
-
-  for ( cpu = 1 ; cpu < max_cpus; ++cpu ) {
-    const Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( cpu );
-
-    _Per_CPU_Wait_for_state(
-      per_cpu,
-      PER_CPU_STATE_READY_TO_BEGIN_MULTITASKING
-    );
-  }
 }
 
 void _SMP_Start_multitasking_on_secondary_processor( void )
@@ -149,6 +140,11 @@ void _SMP_Request_other_cores_to_perform_first_context_switch( void )
     Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( cpu );
 
     if ( cpu != self ) {
+      _Per_CPU_Wait_for_state(
+        per_cpu,
+        PER_CPU_STATE_READY_TO_BEGIN_MULTITASKING
+      );
+
       _Per_CPU_Change_state( per_cpu, PER_CPU_STATE_BEGIN_MULTITASKING );
     }
   }




More information about the vc mailing list