diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-14 10:12:34 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-14 11:57:47 +0200 |
commit | 042072bfdfa6ff6a54c74cc54476c5175377bf63 (patch) | |
tree | c96a1439100a410ff55b3230529b2954d8928f89 /cpukit/score/include/rtems/score/schedulerpriorityimpl.h | |
parent | score: _Thread_Create_idle_for_CPU() (diff) | |
download | rtems-042072bfdfa6ff6a54c74cc54476c5175377bf63.tar.bz2 |
score: _Scheduler_priority_Ready_queue_initialize
Use priority maximum of scheduler instance. This avoids a potential
memory corruption on SMP configurations.
Diffstat (limited to 'cpukit/score/include/rtems/score/schedulerpriorityimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/schedulerpriorityimpl.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cpukit/score/include/rtems/score/schedulerpriorityimpl.h b/cpukit/score/include/rtems/score/schedulerpriorityimpl.h index ab5abdc65f..a18840fb4c 100644 --- a/cpukit/score/include/rtems/score/schedulerpriorityimpl.h +++ b/cpukit/score/include/rtems/score/schedulerpriorityimpl.h @@ -54,14 +54,15 @@ RTEMS_INLINE_ROUTINE Scheduler_priority_Node *_Scheduler_priority_Thread_get_nod * This routine initializes @a ready_queues for priority-based scheduling. */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_initialize( - Chain_Control *ready_queues + Chain_Control *ready_queues, + Priority_Control maximum_priority ) { size_t index; - /* initialize ready queue structures */ - for( index=0; index <= PRIORITY_MAXIMUM; index++) - _Chain_Initialize_empty( &ready_queues[index] ); + for ( index = 0 ; index <= (size_t) maximum_priority ; ++index ) { + _Chain_Initialize_empty( &ready_queues[ index ] ); + } } /** |