diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-01 15:20:17 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-05 13:45:36 +0200 |
commit | b4b309c55940da12cbf099ffe19bc74179505fda (patch) | |
tree | 716a05c54f35a421305ff14d7451f3805d55994f /cpukit/score/src/smp.c | |
parent | score: Delete SYSTEM_STATE_BEGIN_MULTITASKING (diff) | |
download | rtems-b4b309c55940da12cbf099ffe19bc74179505fda.tar.bz2 |
smp: Generalize _Thread_Start_multitasking()
Add context parameter to _Thread_Start_multitasking() and use this
function in rtems_smp_secondary_cpu_initialize(). This avoids
duplication of code.
Fix missing floating point context initialization in
rtems_smp_secondary_cpu_initialize(). Now performed via
_Thread_Start_multitasking().
Diffstat (limited to 'cpukit/score/src/smp.c')
-rw-r--r-- | cpukit/score/src/smp.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c index 5b299b4feb..4f7229092c 100644 --- a/cpukit/score/src/smp.c +++ b/cpukit/score/src/smp.c @@ -19,8 +19,8 @@ #endif #include <rtems/bspsmp.h> -#include <rtems/score/thread.h> #include <rtems/score/threaddispatch.h> +#include <rtems/score/threadimpl.h> #include <rtems/score/smp.h> #include <rtems/score/sysstate.h> @@ -41,27 +41,7 @@ void rtems_smp_secondary_cpu_initialize( void ) _Per_CPU_Wait_for_state( self_cpu, PER_CPU_STATE_BEGIN_MULTITASKING ); - _Per_CPU_Change_state( self_cpu, PER_CPU_STATE_UP ); - - /* - * The Scheduler will have selected the heir thread for each CPU core. - * Now we have been requested to perform the first context switch. So - * force a switch to the designated heir and make it executing on - * THIS core. - */ - heir = self_cpu->heir; - heir->is_executing = true; - self_cpu->executing->is_executing = false; - self_cpu->executing = heir; - self_cpu->dispatch_necessary = false; - - /* - * Threads begin execution in the _Thread_Handler() function. This function - * will call _Thread_Enable_dispatch(). - */ - _Thread_Disable_dispatch(); - - _CPU_Context_switch_to_first_task_smp( &heir->Registers ); + _Thread_Start_multitasking( NULL ); } void rtems_smp_process_interrupt( void ) @@ -158,9 +138,6 @@ void _SMP_Request_other_cores_to_perform_first_context_switch( void ) if ( cpu != self ) { _Per_CPU_Change_state( per_cpu, PER_CPU_STATE_BEGIN_MULTITASKING ); - } else { - - _Per_CPU_Change_state( per_cpu, PER_CPU_STATE_UP ); } } } |