diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-07-24 11:18:27 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-07-25 10:07:42 +0200 |
commit | 406dd62c9927af547987ad1326d4b7512c320ff9 (patch) | |
tree | f0c1bbd131f56720195da5bad29f9e20fbea96e8 /cpukit | |
parent | bsps: bsp_start_on_secondary_processor() (diff) | |
download | rtems-406dd62c9927af547987ad1326d4b7512c320ff9.tar.bz2 |
_SMP_Start_multitasking_on_secondary_processor()
Pass current processor control as first parameter to make dependency
more explicit.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/include/rtems/score/smpimpl.h | 7 | ||||
-rw-r--r-- | cpukit/score/src/smp.c | 26 |
2 files changed, 22 insertions, 11 deletions
diff --git a/cpukit/include/rtems/score/smpimpl.h b/cpukit/include/rtems/score/smpimpl.h index fd92f655c7..762b3e5fc1 100644 --- a/cpukit/include/rtems/score/smpimpl.h +++ b/cpukit/include/rtems/score/smpimpl.h @@ -134,9 +134,12 @@ extern Processor_mask _SMP_Online_processors; * uses _Thread_Start_multitasking() instead. * * This function does not return to the caller. + * + * @param[in] cpu_self The current processor control. */ -void _SMP_Start_multitasking_on_secondary_processor( void ) - RTEMS_NO_RETURN; +void _SMP_Start_multitasking_on_secondary_processor( + Per_CPU_Control *cpu_self +) RTEMS_NO_RETURN; typedef void ( *SMP_Test_message_handler )( Per_CPU_Control *cpu_self ); diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c index 1a29e37d15..1c7eb6d947 100644 --- a/cpukit/score/src/smp.c +++ b/cpukit/score/src/smp.c @@ -145,14 +145,19 @@ void _SMP_Handler_initialize( void ) void _SMP_Request_start_multitasking( void ) { - Per_CPU_Control *self_cpu = _Per_CPU_Get(); - uint32_t cpu_count = _SMP_Get_processor_count(); - uint32_t cpu_index; + Per_CPU_Control *cpu_self; + uint32_t cpu_count; + uint32_t cpu_index; + + cpu_self = _Per_CPU_Get(); + _Per_CPU_State_change( cpu_self, PER_CPU_STATE_READY_TO_START_MULTITASKING ); - _Per_CPU_State_change( self_cpu, PER_CPU_STATE_READY_TO_START_MULTITASKING ); + cpu_count = _SMP_Get_processor_count(); for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) { - Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index ); + Per_CPU_Control *cpu; + + cpu = _Per_CPU_Get_by_index( cpu_index ); if ( _Per_CPU_Is_processor_online( cpu ) ) { _Per_CPU_State_change( cpu, PER_CPU_STATE_REQUEST_START_MULTITASKING ); @@ -168,10 +173,13 @@ bool _SMP_Should_start_processor( uint32_t cpu_index ) return _Scheduler_Should_start_processor( assignment ); } -void _SMP_Start_multitasking_on_secondary_processor( void ) +void _SMP_Start_multitasking_on_secondary_processor( + Per_CPU_Control *cpu_self +) { - Per_CPU_Control *self_cpu = _Per_CPU_Get(); - uint32_t cpu_index_self = _Per_CPU_Get_index( self_cpu ); + uint32_t cpu_index_self; + + cpu_index_self = _Per_CPU_Get_index( cpu_self ); if ( cpu_index_self >= rtems_configuration_get_maximum_processors() ) { _SMP_Fatal( SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR ); @@ -181,7 +189,7 @@ void _SMP_Start_multitasking_on_secondary_processor( void ) _SMP_Fatal( SMP_FATAL_MULTITASKING_START_ON_UNASSIGNED_PROCESSOR ); } - _Per_CPU_State_change( self_cpu, PER_CPU_STATE_READY_TO_START_MULTITASKING ); + _Per_CPU_State_change( cpu_self, PER_CPU_STATE_READY_TO_START_MULTITASKING ); _Thread_Start_multitasking(); } |