From b4b309c55940da12cbf099ffe19bc74179505fda Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 1 Aug 2013 15:20:17 +0200 Subject: 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(). --- cpukit/score/src/smp.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'cpukit/score/src/smp.c') 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 -#include #include +#include #include #include @@ -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 ); } } } -- cgit v1.2.3