diff options
Diffstat (limited to 'cpukit/score/include/rtems/score')
-rw-r--r-- | cpukit/score/include/rtems/score/schedulersimple.h | 10 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/schedulersimpleimpl.h | 10 |
2 files changed, 17 insertions, 3 deletions
diff --git a/cpukit/score/include/rtems/score/schedulersimple.h b/cpukit/score/include/rtems/score/schedulersimple.h index db9c8f3834..54b0801872 100644 --- a/cpukit/score/include/rtems/score/schedulersimple.h +++ b/cpukit/score/include/rtems/score/schedulersimple.h @@ -55,6 +55,16 @@ extern "C" { } /** + * @brief Simple scheduler control. + */ +typedef struct { + /** + * @brief One ready queue for all ready threads. + */ + Chain_Control Ready; +} Scheduler_simple_Control; + +/** * @brief Initialize simple scheduler. * * This routine initializes the simple scheduler. diff --git a/cpukit/score/include/rtems/score/schedulersimpleimpl.h b/cpukit/score/include/rtems/score/schedulersimpleimpl.h index 25fbbc7b3c..c51c6c3f0e 100644 --- a/cpukit/score/include/rtems/score/schedulersimpleimpl.h +++ b/cpukit/score/include/rtems/score/schedulersimpleimpl.h @@ -32,6 +32,11 @@ extern "C" { */ /**@{**/ +RTEMS_INLINE_ROUTINE Scheduler_simple_Control *_Scheduler_simple_Instance( void ) +{ + return _Scheduler.information; +} + /** * This routine puts @a the_thread on to the ready queue. * @@ -101,9 +106,8 @@ RTEMS_INLINE_ROUTINE void _Scheduler_simple_Schedule_body( bool force_dispatch ) { - Thread_Control *heir = (Thread_Control *) _Chain_First( - (Chain_Control *) _Scheduler.information - ); + Scheduler_simple_Control *scheduler = _Scheduler_simple_Instance(); + Thread_Control *heir = (Thread_Control *) _Chain_First( &scheduler->Ready ); ( void ) thread; |