Changeset e610785 in rtems for cpukit/score/src/smp.c


Ignore:
Timestamp:
Nov 7, 2016, 7:06:48 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
1f5bee3
Parents:
68ef65b
git-author:
Sebastian Huber <sebastian.huber@…> (11/07/16 07:06:48)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/09/16 14:27:29)
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/smp.c

    r68ef65b re610785  
    3333uint32_t _SMP_Processor_count;
    3434
     35static const Scheduler_Assignment *_Scheduler_Get_initial_assignment(
     36  uint32_t cpu_index
     37)
     38{
     39  return &_Scheduler_Initial_assignments[ cpu_index ];
     40}
     41
     42static bool _Scheduler_Is_mandatory_processor(
     43  const Scheduler_Assignment *assignment
     44)
     45{
     46  return (assignment->attributes & SCHEDULER_ASSIGN_PROCESSOR_MANDATORY) != 0;
     47}
     48
     49static bool _Scheduler_Should_start_processor(
     50  const Scheduler_Assignment *assignment
     51)
     52{
     53  return assignment->scheduler != NULL;
     54}
     55
    3556static void _SMP_Start_processors( uint32_t cpu_count )
    3657{
    37   uint32_t cpu_index_self = _SMP_Get_current_processor();
    38   uint32_t cpu_index;
     58  uint32_t cpu_index_self;
     59  uint32_t cpu_index;
     60
     61  cpu_index_self = _SMP_Get_current_processor();
    3962
    4063  for ( cpu_index = 0 ; cpu_index < cpu_count; ++cpu_index ) {
    41     const Scheduler_Assignment *assignment =
    42       _Scheduler_Get_assignment( cpu_index );
    43     Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index );
    44     bool started;
     64    const Scheduler_Assignment *assignment;
     65    Per_CPU_Control            *cpu;
     66    bool                        started;
     67
     68    assignment = _Scheduler_Get_initial_assignment( cpu_index );
     69    cpu = _Per_CPU_Get_by_index( cpu_index );
    4570
    4671    if ( cpu_index != cpu_index_self ) {
     
    106131
    107132  for ( cpu_index = cpu_count ; cpu_index < cpu_max; ++cpu_index ) {
    108     const Scheduler_Assignment *assignment =
    109       _Scheduler_Get_assignment( cpu_index );
     133    const Scheduler_Assignment *assignment;
     134
     135    assignment = _Scheduler_Get_initial_assignment( cpu_index );
    110136
    111137    if ( _Scheduler_Is_mandatory_processor( assignment ) ) {
     
    138164bool _SMP_Should_start_processor( uint32_t cpu_index )
    139165{
    140   const Scheduler_Assignment *assignment =
    141     _Scheduler_Get_assignment( cpu_index );
    142 
     166  const Scheduler_Assignment *assignment;
     167
     168  assignment = _Scheduler_Get_initial_assignment( cpu_index );
    143169  return _Scheduler_Should_start_processor( assignment );
    144170}
Note: See TracChangeset for help on using the changeset viewer.