summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/smp.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-07 08:06:48 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-09 15:27:29 +0100
commite6107854b2511decef8c209cde14c4826a33ff01 (patch)
tree13bb32bdf25b5d59d225d74edbe5e0d053d8f77e /cpukit/score/src/smp.c
parentscore: Clarify _Scheduler_SMP_Start_idle() (diff)
downloadrtems-e6107854b2511decef8c209cde14c4826a33ff01.tar.bz2
score: Rename _Scheduler_Assignments
Rename _Scheduler_Assignments into _Scheduler_Initial_assignments to make it clear that they may not reflect the run-time scheduler assignment. Update #2797.
Diffstat (limited to 'cpukit/score/src/smp.c')
-rw-r--r--cpukit/score/src/smp.c44
1 files changed, 35 insertions, 9 deletions
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
index c880d7eb5d..ab9c7a6115 100644
--- a/cpukit/score/src/smp.c
+++ b/cpukit/score/src/smp.c
@@ -32,16 +32,41 @@ Processor_mask _SMP_Online_processors;
uint32_t _SMP_Processor_count;
+static const Scheduler_Assignment *_Scheduler_Get_initial_assignment(
+ uint32_t cpu_index
+)
+{
+ return &_Scheduler_Initial_assignments[ cpu_index ];
+}
+
+static bool _Scheduler_Is_mandatory_processor(
+ const Scheduler_Assignment *assignment
+)
+{
+ return (assignment->attributes & SCHEDULER_ASSIGN_PROCESSOR_MANDATORY) != 0;
+}
+
+static bool _Scheduler_Should_start_processor(
+ const Scheduler_Assignment *assignment
+)
+{
+ return assignment->scheduler != NULL;
+}
+
static void _SMP_Start_processors( uint32_t cpu_count )
{
- uint32_t cpu_index_self = _SMP_Get_current_processor();
+ uint32_t cpu_index_self;
uint32_t cpu_index;
+ cpu_index_self = _SMP_Get_current_processor();
+
for ( cpu_index = 0 ; cpu_index < cpu_count; ++cpu_index ) {
- const Scheduler_Assignment *assignment =
- _Scheduler_Get_assignment( cpu_index );
- Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index );
- bool started;
+ const Scheduler_Assignment *assignment;
+ Per_CPU_Control *cpu;
+ bool started;
+
+ assignment = _Scheduler_Get_initial_assignment( cpu_index );
+ cpu = _Per_CPU_Get_by_index( cpu_index );
if ( cpu_index != cpu_index_self ) {
if ( _Scheduler_Should_start_processor( assignment ) ) {
@@ -105,8 +130,9 @@ void _SMP_Handler_initialize( void )
_SMP_Processor_count = cpu_count;
for ( cpu_index = cpu_count ; cpu_index < cpu_max; ++cpu_index ) {
- const Scheduler_Assignment *assignment =
- _Scheduler_Get_assignment( cpu_index );
+ const Scheduler_Assignment *assignment;
+
+ assignment = _Scheduler_Get_initial_assignment( cpu_index );
if ( _Scheduler_Is_mandatory_processor( assignment ) ) {
_SMP_Fatal( SMP_FATAL_MANDATORY_PROCESSOR_NOT_PRESENT );
@@ -137,9 +163,9 @@ void _SMP_Request_start_multitasking( void )
bool _SMP_Should_start_processor( uint32_t cpu_index )
{
- const Scheduler_Assignment *assignment =
- _Scheduler_Get_assignment( cpu_index );
+ const Scheduler_Assignment *assignment;
+ assignment = _Scheduler_Get_initial_assignment( cpu_index );
return _Scheduler_Should_start_processor( assignment );
}