From 2369b10a71d4a0aa0be3bbfc51f1fb402d8427a7 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 14 May 2014 16:04:10 +0200 Subject: score: Add and use _Scheduler_Get_context() --- cpukit/score/include/rtems/score/scheduleredfimpl.h | 2 +- cpukit/score/include/rtems/score/schedulerimpl.h | 9 ++++++++- cpukit/score/include/rtems/score/schedulerpriorityimpl.h | 2 +- cpukit/score/include/rtems/score/schedulersimpleimpl.h | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) (limited to 'cpukit/score/include/rtems/score') diff --git a/cpukit/score/include/rtems/score/scheduleredfimpl.h b/cpukit/score/include/rtems/score/scheduleredfimpl.h index 708557f78e..8c4cd2c4bd 100644 --- a/cpukit/score/include/rtems/score/scheduleredfimpl.h +++ b/cpukit/score/include/rtems/score/scheduleredfimpl.h @@ -34,7 +34,7 @@ extern "C" { RTEMS_INLINE_ROUTINE Scheduler_EDF_Context * _Scheduler_EDF_Get_context( const Scheduler_Control *scheduler ) { - return (Scheduler_EDF_Context *) scheduler->context; + return (Scheduler_EDF_Context *) _Scheduler_Get_context( scheduler ); } RTEMS_INLINE_ROUTINE Scheduler_EDF_Node *_Scheduler_EDF_Node_get( diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h index c972ef57bd..2129493b0a 100644 --- a/cpukit/score/include/rtems/score/schedulerimpl.h +++ b/cpukit/score/include/rtems/score/schedulerimpl.h @@ -578,12 +578,19 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Change_priority_if_higher( } } +RTEMS_INLINE_ROUTINE Scheduler_Context *_Scheduler_Get_context( + const Scheduler_Control *scheduler +) +{ + return scheduler->context; +} + RTEMS_INLINE_ROUTINE uint32_t _Scheduler_Get_processor_count( const Scheduler_Control *scheduler ) { #if defined(RTEMS_SMP) - return scheduler->context->processor_count; + return _Scheduler_Get_context( scheduler )->processor_count; #else (void) scheduler; diff --git a/cpukit/score/include/rtems/score/schedulerpriorityimpl.h b/cpukit/score/include/rtems/score/schedulerpriorityimpl.h index ffcc2d32cf..ae0cd1ad9b 100644 --- a/cpukit/score/include/rtems/score/schedulerpriorityimpl.h +++ b/cpukit/score/include/rtems/score/schedulerpriorityimpl.h @@ -38,7 +38,7 @@ extern "C" { RTEMS_INLINE_ROUTINE Scheduler_priority_Context * _Scheduler_priority_Get_context( const Scheduler_Control *scheduler ) { - return (Scheduler_priority_Context *) scheduler->context; + return (Scheduler_priority_Context *) _Scheduler_Get_context( scheduler ); } RTEMS_INLINE_ROUTINE Scheduler_priority_Node *_Scheduler_priority_Node_get( diff --git a/cpukit/score/include/rtems/score/schedulersimpleimpl.h b/cpukit/score/include/rtems/score/schedulersimpleimpl.h index cc79c15376..c256071a8f 100644 --- a/cpukit/score/include/rtems/score/schedulersimpleimpl.h +++ b/cpukit/score/include/rtems/score/schedulersimpleimpl.h @@ -35,7 +35,7 @@ extern "C" { RTEMS_INLINE_ROUTINE Scheduler_simple_Context * _Scheduler_simple_Get_context( const Scheduler_Control *scheduler ) { - return (Scheduler_simple_Context *) scheduler->context; + return (Scheduler_simple_Context *) _Scheduler_Get_context( scheduler ); } /** -- cgit v1.2.3