From 439c494fe20f474984c22a333613c33fac5585eb Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 3 Apr 2014 12:02:09 +0200 Subject: score: Add and use Scheduler_simple_Control --- cpukit/score/include/rtems/score/schedulersimple.h | 10 ++++++++++ cpukit/score/include/rtems/score/schedulersimpleimpl.h | 10 +++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'cpukit/score/include/rtems') 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 @@ -54,6 +54,16 @@ extern "C" { _Scheduler_default_Start_idle /* start idle entry point */ \ } +/** + * @brief Simple scheduler control. + */ +typedef struct { + /** + * @brief One ready queue for all ready threads. + */ + Chain_Control Ready; +} Scheduler_simple_Control; + /** * @brief Initialize 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; -- cgit v1.2.3