summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/smp.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-07-24 11:18:27 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-07-25 10:07:42 +0200
commit406dd62c9927af547987ad1326d4b7512c320ff9 (patch)
treef0c1bbd131f56720195da5bad29f9e20fbea96e8 /cpukit/score/src/smp.c
parentbsps: bsp_start_on_secondary_processor() (diff)
downloadrtems-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/score/src/smp.c')
-rw-r--r--cpukit/score/src/smp.c26
1 files changed, 17 insertions, 9 deletions
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();
}