Changeset 042072b in rtems


Ignore:
Timestamp:
Jun 14, 2016, 8:12:34 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
b61d5cac
Parents:
3eda7e5
git-author:
Sebastian Huber <sebastian.huber@…> (06/14/16 08:12:34)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/14/16 09:57:47)
Message:

score: _Scheduler_priority_Ready_queue_initialize

Use priority maximum of scheduler instance. This avoids a potential
memory corruption on SMP configurations.

Location:
cpukit/score
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/schedulerpriorityimpl.h

    r3eda7e5 r042072b  
    5555 */
    5656RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_initialize(
    57   Chain_Control *ready_queues
     57  Chain_Control    *ready_queues,
     58  Priority_Control  maximum_priority
    5859)
    5960{
    6061  size_t index;
    6162
    62   /* initialize ready queue structures */
    63   for( index=0; index <= PRIORITY_MAXIMUM; index++)
    64     _Chain_Initialize_empty( &ready_queues[index] );
     63  for ( index = 0 ; index <= (size_t) maximum_priority ; ++index ) {
     64    _Chain_Initialize_empty( &ready_queues[ index ] );
     65  }
    6566}
    6667
  • cpukit/score/src/schedulerpriority.c

    r3eda7e5 r042072b  
    2828
    2929  _Priority_bit_map_Initialize( &context->Bit_map );
    30   _Scheduler_priority_Ready_queue_initialize( &context->Ready[ 0 ] );
     30  _Scheduler_priority_Ready_queue_initialize(
     31    &context->Ready[ 0 ],
     32    scheduler->maximum_priority
     33  );
    3134}
  • cpukit/score/src/schedulerprioritysmp.c

    r3eda7e5 r042072b  
    4040  _Scheduler_SMP_Initialize( &self->Base );
    4141  _Priority_bit_map_Initialize( &self->Bit_map );
    42   _Scheduler_priority_Ready_queue_initialize( &self->Ready[ 0 ] );
     42  _Scheduler_priority_Ready_queue_initialize(
     43    &self->Ready[ 0 ],
     44    scheduler->maximum_priority
     45  );
    4346}
    4447
  • cpukit/score/src/schedulerstrongapa.c

    r3eda7e5 r042072b  
    166166  _Scheduler_SMP_Initialize( &self->Base );
    167167  _Priority_bit_map_Initialize( &self->Bit_map );
    168   _Scheduler_priority_Ready_queue_initialize( &self->Ready[ 0 ] );
     168  _Scheduler_priority_Ready_queue_initialize(
     169    &self->Ready[ 0 ],
     170    scheduler->maximum_priority
     171  );
    169172}
    170173
Note: See TracChangeset for help on using the changeset viewer.