From e1598a616db1e9dadfd74abeb20b1f1ec5daaa7f Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 4 Apr 2014 10:56:36 +0200 Subject: score: Static scheduler configuration Do not allocate the scheduler control structures from the workspace. This is a preparation step for configuration of clustered/partitioned schedulers on SMP. --- cpukit/score/include/rtems/score/scheduler.h | 130 ++++++++++++-------- cpukit/score/include/rtems/score/schedulercbs.h | 26 ++-- cpukit/score/include/rtems/score/scheduleredf.h | 55 +++++---- .../score/include/rtems/score/scheduleredfimpl.h | 18 +-- cpukit/score/include/rtems/score/schedulerimpl.h | 131 +++++++++++---------- .../score/include/rtems/score/schedulerpriority.h | 51 ++++---- .../rtems/score/schedulerpriorityaffinitysmp.h | 20 ++-- .../include/rtems/score/schedulerpriorityimpl.h | 30 ++--- .../include/rtems/score/schedulerprioritysmp.h | 24 ++-- cpukit/score/include/rtems/score/schedulersimple.h | 47 ++++---- .../include/rtems/score/schedulersimpleimpl.h | 22 ++-- .../score/include/rtems/score/schedulersimplesmp.h | 21 ++-- cpukit/score/include/rtems/score/schedulersmp.h | 18 +-- .../score/include/rtems/score/schedulersmpimpl.h | 28 ++--- 14 files changed, 343 insertions(+), 278 deletions(-) (limited to 'cpukit/score/include/rtems/score') diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h index b975fc4a3e..931f008c06 100644 --- a/cpukit/score/include/rtems/score/scheduler.h +++ b/cpukit/score/include/rtems/score/scheduler.h @@ -20,8 +20,8 @@ #define _RTEMS_SCORE_SCHEDULER_H #include -#include #include +#include #if defined(__RTEMS_HAVE_SYS_CPUSET_H__) && defined(RTEMS_SMP) #include #endif @@ -48,42 +48,42 @@ typedef struct Scheduler_Control Scheduler_Control; */ typedef struct { /** Implements the scheduling decision logic (policy). */ - void ( *initialize )(void); + void ( *initialize )( const Scheduler_Control * ); /** Implements the scheduling decision logic (policy). */ - void ( *schedule )( Scheduler_Control *, Thread_Control *); + void ( *schedule )( const Scheduler_Control *, Thread_Control *); /** * @brief Voluntarily yields the processor per the scheduling policy. * * @see _Scheduler_Yield(). */ - void ( *yield )( Scheduler_Control *, Thread_Control *); + void ( *yield )( const Scheduler_Control *, Thread_Control *); /** Removes the given thread from scheduling decisions. */ - void ( *block )( Scheduler_Control *, Thread_Control * ); + void ( *block )( const Scheduler_Control *, Thread_Control * ); /** Adds the given thread to scheduling decisions. */ - void ( *unblock )( Scheduler_Control *, Thread_Control * ); + void ( *unblock )( const Scheduler_Control *, Thread_Control * ); /** allocates the scheduler field of the given thread */ - void * ( *allocate )( Scheduler_Control *, Thread_Control * ); + void * ( *allocate )( const Scheduler_Control *, Thread_Control * ); /** frees the scheduler field of the given thread */ - void ( *free )( Scheduler_Control *, Thread_Control * ); + void ( *free )( const Scheduler_Control *, Thread_Control * ); /** updates the scheduler field of the given thread -- primarily used * when changing the thread's priority. */ - void ( *update )( Scheduler_Control *, Thread_Control * ); + void ( *update )( const Scheduler_Control *, Thread_Control * ); /** enqueue a thread as the last of its priority group */ - void ( *enqueue )( Scheduler_Control *, Thread_Control * ); + void ( *enqueue )( const Scheduler_Control *, Thread_Control * ); /** enqueue a thread as the first of its priority group */ - void ( *enqueue_first )( Scheduler_Control *, Thread_Control * ); + void ( *enqueue_first )( const Scheduler_Control *, Thread_Control * ); /** extract a thread from the ready set */ - void ( *extract )( Scheduler_Control *, Thread_Control * ); + void ( *extract )( const Scheduler_Control *, Thread_Control * ); /** * Compares two priorities (returns >0 for higher priority, 0 for equal @@ -95,10 +95,14 @@ typedef struct { ); /** This routine is called upon release of a new job. */ - void ( *release_job ) ( Scheduler_Control *, Thread_Control *, uint32_t ); + void ( *release_job ) ( + const Scheduler_Control *, + Thread_Control *, + uint32_t + ); /** perform scheduler update actions required at each clock tick */ - void ( *tick )( Scheduler_Control * ); + void ( *tick )( const Scheduler_Control * ); /** * @brief Starts the idle thread for a particular processor. @@ -106,7 +110,7 @@ typedef struct { * @see _Scheduler_Start_idle(). */ void ( *start_idle )( - Scheduler_Control *, + const Scheduler_Control *, Thread_Control *, Per_CPU_Control * ); @@ -118,7 +122,7 @@ typedef struct { * @see _Scheduler_Get_affinity(). */ bool ( *get_affinity )( - Scheduler_Control *, + const Scheduler_Control *, Thread_Control *, size_t, cpu_set_t * @@ -130,7 +134,7 @@ typedef struct { * @see _Scheduler_Set_affinity(). */ bool ( *set_affinity )( - Scheduler_Control *, + const Scheduler_Control *, Thread_Control *, size_t, const cpu_set_t * @@ -139,29 +143,55 @@ typedef struct { } Scheduler_Operations; /** - * This is the structure used to manage the scheduler. + * @brief Scheduler context. + * + * The scheduler context of a particular scheduler implementation must place + * this structure at the begin of its context structure. + */ +typedef struct { + /* No fields yet */ +} Scheduler_Context; + +/** + * @brief Scheduler control. */ struct Scheduler_Control { /** - * This points to the data structure used to manage the ready set of - * tasks. The pointer varies based upon the type of - * ready queue required by the scheduler. + * @brief Reference to a statically allocated scheduler context. */ - void *information; + Scheduler_Context *context; - /** The jump table for scheduler-specific functions */ - Scheduler_Operations Operations; + /** + * @brief The scheduler operations. + */ + Scheduler_Operations Operations; }; /** - * The _Scheduler holds the structures used to manage the - * scheduler. + * @brief Registered schedulers. + * + * Application provided via . + * + * @see _Scheduler_Count. + */ +extern const Scheduler_Control _Scheduler_Table[]; + +/** + * @brief Count of registered schedulers. * - * @note Can we make this per-cpu? then _Scheduler will be a macro. + * Application provided via on SMP configurations. * - * @note This is instantiated and initialized in confdefs.h. + * It is very important that this is a compile-time constant on uni-processor + * configurations (in this case RTEMS_SMP is not defined) so that the compiler + * can optimize the some loops away + * + * @see _Scheduler_Table. */ -extern Scheduler_Control _Scheduler; +#if defined(RTEMS_SMP) + extern const size_t _Scheduler_Count; +#else + #define _Scheduler_Count ( (size_t) 1 ) +#endif /** * @brief Returns an arbitrary non-NULL value. @@ -172,8 +202,8 @@ extern Scheduler_Control _Scheduler; * @return An arbitrary non-NULL value. */ void *_Scheduler_default_Allocate( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -183,8 +213,8 @@ void *_Scheduler_default_Allocate( * @param[in] the_thread Unused. */ void _Scheduler_default_Free( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -194,8 +224,8 @@ void _Scheduler_default_Free( * @param[in] the_thread Unused. */ void _Scheduler_default_Update( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -206,9 +236,9 @@ void _Scheduler_default_Update( * @param[in] deadline Unused. */ void _Scheduler_default_Release_job( - Scheduler_Control *scheduler, - Thread_Control *the_thread, - uint32_t deadline + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + uint32_t deadline ); /** @@ -219,7 +249,7 @@ void _Scheduler_default_Release_job( * * @param[in] scheduler The scheduler. */ -void _Scheduler_default_Tick( Scheduler_Control *scheduler ); +void _Scheduler_default_Tick( const Scheduler_Control *scheduler ); /** * @brief Starts an idle thread. @@ -229,9 +259,9 @@ void _Scheduler_default_Tick( Scheduler_Control *scheduler ); * @param[in] cpu This parameter is unused. */ void _Scheduler_default_Start_idle( - Scheduler_Control *scheduler, - Thread_Control *the_thread, - Per_CPU_Control *cpu + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + Per_CPU_Control *cpu ); #if defined(__RTEMS_HAVE_SYS_CPUSET_H__) && defined(RTEMS_SMP) @@ -246,10 +276,10 @@ void _Scheduler_default_Start_idle( * @retval -1 The cpusetsize is invalid for the system */ bool _Scheduler_default_Get_affinity( - Scheduler_Control *scheduler, - Thread_Control *thread, - size_t cpusetsize, - cpu_set_t *cpuset + const Scheduler_Control *scheduler, + Thread_Control *thread, + size_t cpusetsize, + cpu_set_t *cpuset ); /** @@ -265,10 +295,10 @@ void _Scheduler_default_Start_idle( * the cpuset. */ bool _Scheduler_default_Set_affinity( - Scheduler_Control *scheduler, - Thread_Control *thread, - size_t cpusetsize, - const cpu_set_t *cpuset + const Scheduler_Control *scheduler, + Thread_Control *thread, + size_t cpusetsize, + const cpu_set_t *cpuset ); #endif diff --git a/cpukit/score/include/rtems/score/schedulercbs.h b/cpukit/score/include/rtems/score/schedulercbs.h index f654225f58..3abfdc5d99 100644 --- a/cpukit/score/include/rtems/score/schedulercbs.h +++ b/cpukit/score/include/rtems/score/schedulercbs.h @@ -81,7 +81,7 @@ extern "C" { #define SCHEDULER_CBS_ERROR_NOSERVER SCHEDULER_CBS_ERROR_NOT_FOUND /** Maximum number of simultaneous servers. */ -extern uint32_t _Scheduler_CBS_Maximum_servers; +extern const uint32_t _Scheduler_CBS_Maximum_servers; /** Server id. */ typedef uint32_t Scheduler_CBS_Server_id; @@ -115,6 +115,13 @@ typedef struct { Scheduler_CBS_Parameters parameters; /** Callback function invoked when a budget overrun occurs. */ Scheduler_CBS_Budget_overrun cbs_budget_overrun; + + /** + * @brief Indicates if this CBS server is initialized. + * + * @see _Scheduler_CBS_Create_server() and _Scheduler_CBS_Destroy_server(). + */ + bool initialized; } Scheduler_CBS_Server; /** @@ -132,7 +139,7 @@ typedef struct { * List of servers. The @a Scheduler_CBS_Server is the index to the array * of pointers to @a _Scheduler_CBS_Server_list. */ -extern Scheduler_CBS_Server **_Scheduler_CBS_Server_list; +extern Scheduler_CBS_Server _Scheduler_CBS_Server_list[]; /** * @brief Unblocks a thread from the queue. @@ -148,8 +155,8 @@ extern Scheduler_CBS_Server **_Scheduler_CBS_Server_list; * @note This has to be asessed as missed deadline of the current job. */ void _Scheduler_CBS_Unblock( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -165,9 +172,9 @@ void _Scheduler_CBS_Unblock( */ void _Scheduler_CBS_Release_job ( - Scheduler_Control *scheduler, - Thread_Control *the_thread, - uint32_t length + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + uint32_t length ); /** @@ -338,9 +345,10 @@ void _Scheduler_CBS_Budget_callout( * management memory for. */ void *_Scheduler_CBS_Allocate( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); + #ifdef __cplusplus } #endif diff --git a/cpukit/score/include/rtems/score/scheduleredf.h b/cpukit/score/include/rtems/score/scheduleredf.h index 16d46a4928..c6aba2dee2 100644 --- a/cpukit/score/include/rtems/score/scheduleredf.h +++ b/cpukit/score/include/rtems/score/scheduleredf.h @@ -67,11 +67,16 @@ extern "C" { #define SCHEDULER_EDF_PRIO_MSB 0x80000000 typedef struct { + /** + * @brief Basic scheduler context. + */ + Scheduler_Context Base; + /** * Top of the ready queue. */ RBTree_Control Ready; -} Scheduler_EDF_Control; +} Scheduler_EDF_Context; /** * @typedef Scheduler_EDF_Queue_state @@ -108,7 +113,7 @@ typedef struct { * * This routine initializes the EDF scheduler. */ -void _Scheduler_EDF_Initialize( void ); +void _Scheduler_EDF_Initialize( const Scheduler_Control *scheduler ); /** * @brief Removes thread from ready queue. @@ -121,8 +126,8 @@ void _Scheduler_EDF_Initialize( void ); * @param[in] the_thread is the thread to be blocked. */ void _Scheduler_EDF_Block( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -133,8 +138,8 @@ void _Scheduler_EDF_Block( * in the rbtree ready queue. */ void _Scheduler_EDF_Schedule( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -146,8 +151,8 @@ void _Scheduler_EDF_Schedule( * management memory for. */ void *_Scheduler_EDF_Allocate( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -159,8 +164,8 @@ void *_Scheduler_EDF_Allocate( * will be deallocated. */ void _Scheduler_EDF_Free( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -172,8 +177,8 @@ void _Scheduler_EDF_Free( * structure updated. */ void _Scheduler_EDF_Update( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -186,8 +191,8 @@ void _Scheduler_EDF_Update( * @param[in] the_thread will be unblocked. */ void _Scheduler_EDF_Unblock( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -206,8 +211,8 @@ void _Scheduler_EDF_Unblock( * @param[in,out] thread The yielding thread. */ void _Scheduler_EDF_Yield( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -218,8 +223,8 @@ void _Scheduler_EDF_Yield( * @param[in] the_thread will be enqueued to the ready queue. */ void _Scheduler_EDF_Enqueue( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -231,8 +236,8 @@ void _Scheduler_EDF_Enqueue( * @param[in] the_thread will be enqueued to the ready queue. */ void _Scheduler_EDF_Enqueue_first( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -245,8 +250,8 @@ void _Scheduler_EDF_Enqueue_first( * @param[in] the_thread will be extracted from the ready set. */ void _Scheduler_EDF_Extract( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -275,9 +280,9 @@ int _Scheduler_EDF_Priority_compare ( * has to be suspended. */ void _Scheduler_EDF_Release_job ( - Scheduler_Control *scheduler, - Thread_Control *the_thread, - uint32_t deadline + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + uint32_t deadline ); #ifdef __cplusplus diff --git a/cpukit/score/include/rtems/score/scheduleredfimpl.h b/cpukit/score/include/rtems/score/scheduleredfimpl.h index bfeff639dd..d4b197e442 100644 --- a/cpukit/score/include/rtems/score/scheduleredfimpl.h +++ b/cpukit/score/include/rtems/score/scheduleredfimpl.h @@ -31,21 +31,21 @@ extern "C" { * @{ */ -RTEMS_INLINE_ROUTINE Scheduler_EDF_Control * - _Scheduler_EDF_Self_from_base( Scheduler_Control *scheduler_base ) +RTEMS_INLINE_ROUTINE Scheduler_EDF_Context * + _Scheduler_EDF_Get_context( const Scheduler_Control *scheduler ) { - return (Scheduler_EDF_Control *) scheduler_base->information; + return (Scheduler_EDF_Context *) scheduler->context; } RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Schedule_body( - Scheduler_Control *scheduler_base, - Thread_Control *the_thread, - bool force_dispatch + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + bool force_dispatch ) { - Scheduler_EDF_Control *scheduler = - _Scheduler_EDF_Self_from_base( scheduler_base ); - RBTree_Node *first = _RBTree_First(&scheduler->Ready, RBT_LEFT); + Scheduler_EDF_Context *context = + _Scheduler_EDF_Get_context( scheduler ); + RBTree_Node *first = _RBTree_First( &context->Ready, RBT_LEFT ); Scheduler_EDF_Per_thread *sched_info = _RBTree_Container_of(first, Scheduler_EDF_Per_thread, Node); Thread_Control *heir = (Thread_Control *) sched_info->thread; diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h index 6687fcf2e4..25866e5ba7 100644 --- a/cpukit/score/include/rtems/score/schedulerimpl.h +++ b/cpukit/score/include/rtems/score/schedulerimpl.h @@ -64,8 +64,8 @@ void _Scheduler_Handler_initialization( void ); * @param[in] the_thread The thread which state changed previously. */ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ) { ( *scheduler->Operations.schedule )( scheduler, the_thread ); @@ -80,8 +80,8 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( * @param[in] the_thread The yielding thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ) { ( *scheduler->Operations.yield )( scheduler, the_thread ); @@ -96,8 +96,8 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( * including the selection of a new heir thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Block( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ) { ( *scheduler->Operations.block )( scheduler, the_thread ); @@ -112,8 +112,8 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Block( * scheduling variables, for example the heir thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Unblock( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ) { ( *scheduler->Operations.unblock )( scheduler, the_thread ); @@ -125,8 +125,8 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Unblock( * This routine allocates @a the_thread->scheduler */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ) { return ( *scheduler->Operations.allocate )( scheduler, the_thread ); @@ -138,8 +138,8 @@ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( * This routine frees @a the_thread->scheduler */ RTEMS_INLINE_ROUTINE void _Scheduler_Free( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ) { ( *scheduler->Operations.free )( scheduler, the_thread ); @@ -151,8 +151,8 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Free( * This routine updates @a the_thread->scheduler */ RTEMS_INLINE_ROUTINE void _Scheduler_Update( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ) { ( *scheduler->Operations.update )( scheduler, the_thread ); @@ -164,8 +164,8 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Update( * This routine enqueue @a the_thread->scheduler */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ) { ( *scheduler->Operations.enqueue )( scheduler, the_thread ); @@ -177,8 +177,8 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( * This routine enqueue_first @a the_thread->scheduler */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ) { ( *scheduler->Operations.enqueue_first )( scheduler, the_thread ); @@ -190,8 +190,8 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( * This routine extract @a the_thread->scheduler */ RTEMS_INLINE_ROUTINE void _Scheduler_Extract( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ) { ( *scheduler->Operations.extract )( scheduler, the_thread ); @@ -203,9 +203,9 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Extract( * This routine compares two priorities. */ RTEMS_INLINE_ROUTINE int _Scheduler_Priority_compare( - Scheduler_Control *scheduler, - Priority_Control p1, - Priority_Control p2 + const Scheduler_Control *scheduler, + Priority_Control p1, + Priority_Control p2 ) { return ( *scheduler->Operations.priority_compare )( p1, p2 ); @@ -217,9 +217,9 @@ RTEMS_INLINE_ROUTINE int _Scheduler_Priority_compare( * This routine is called when a new period of task is issued. */ RTEMS_INLINE_ROUTINE void _Scheduler_Release_job( - Scheduler_Control *scheduler, - Thread_Control *the_thread, - uint32_t length + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + uint32_t length ) { ( *scheduler->Operations.release_job )( scheduler, the_thread, length ); @@ -233,7 +233,9 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Release_job( * scheduler which support standard RTEMS features, this includes * time-slicing management. */ -RTEMS_INLINE_ROUTINE void _Scheduler_Tick( Scheduler_Control *scheduler ) +RTEMS_INLINE_ROUTINE void _Scheduler_Tick( + const Scheduler_Control *scheduler +) { ( *scheduler->Operations.tick )( scheduler ); } @@ -247,9 +249,9 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Tick( Scheduler_Control *scheduler ) * @see _Thread_Create_idle(). */ RTEMS_INLINE_ROUTINE void _Scheduler_Start_idle( - Scheduler_Control *scheduler, - Thread_Control *the_thread, - Per_CPU_Control *cpu + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + Per_CPU_Control *cpu ) { ( *scheduler->Operations.start_idle )( scheduler, the_thread, cpu ); @@ -263,15 +265,15 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Start_idle( * @parma[out] cpuset The processor affinity for this thread */ RTEMS_INLINE_ROUTINE int _Scheduler_Get_affinity( - Scheduler_Control *scheduler, - Thread_Control *thread, - size_t cpusetsize, - cpu_set_t *cpuset + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + size_t cpusetsize, + cpu_set_t *cpuset ) { return ( *scheduler->Operations.get_affinity )( scheduler, - thread, + the_thread, cpusetsize, cpuset ); @@ -284,15 +286,15 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Start_idle( * @parma[in] cpuset The processor affinity for this thread */ RTEMS_INLINE_ROUTINE int _Scheduler_Set_affinity( - Scheduler_Control *scheduler, - Thread_Control *thread, - size_t cpusetsize, - const cpu_set_t *cpuset + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + size_t cpusetsize, + const cpu_set_t *cpuset ) { return ( *scheduler->Operations.set_affinity )( scheduler, - thread, + the_thread, cpusetsize, cpuset ); @@ -313,10 +315,15 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( } RTEMS_INLINE_ROUTINE void _Scheduler_Generic_block( - Scheduler_Control *scheduler, - Thread_Control *the_thread, - void ( *extract )( Scheduler_Control *, Thread_Control * ), - void ( *schedule )( Scheduler_Control *, Thread_Control *, bool ) + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + void ( *extract )( + const Scheduler_Control *, + Thread_Control * ), + void ( *schedule )( + const Scheduler_Control *, + Thread_Control *, + bool ) ) { ( *extract )( scheduler, the_thread ); @@ -333,9 +340,9 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Generic_block( * intuitive sense of priority. */ RTEMS_INLINE_ROUTINE bool _Scheduler_Is_priority_lower_than( - Scheduler_Control *scheduler, - Priority_Control p1, - Priority_Control p2 + const Scheduler_Control *scheduler, + Priority_Control p1, + Priority_Control p2 ) { return _Scheduler_Priority_compare( scheduler, p1, p2 ) < 0; @@ -346,9 +353,9 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_Is_priority_lower_than( * intuitive sense of priority. */ RTEMS_INLINE_ROUTINE bool _Scheduler_Is_priority_higher_than( - Scheduler_Control *scheduler, - Priority_Control p1, - Priority_Control p2 + const Scheduler_Control *scheduler, + Priority_Control p1, + Priority_Control p2 ) { return _Scheduler_Priority_compare( scheduler, p1, p2 ) > 0; @@ -359,9 +366,9 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_Is_priority_higher_than( * in the intuitive sense of priority. */ RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Highest_priority_of_two( - Scheduler_Control *scheduler, - Priority_Control p1, - Priority_Control p2 + const Scheduler_Control *scheduler, + Priority_Control p1, + Priority_Control p2 ) { return _Scheduler_Is_priority_higher_than( scheduler, p1, p2 ) ? p1 : p2; @@ -372,9 +379,9 @@ RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Highest_priority_of_two( * current priority of the thread in the intuitive sense of priority. */ RTEMS_INLINE_ROUTINE void _Scheduler_Set_priority_if_higher( - Scheduler_Control *scheduler, - Thread_Control *the_thread, - Priority_Control priority + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + Priority_Control priority ) { Priority_Control current = the_thread->current_priority; @@ -389,10 +396,10 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Set_priority_if_higher( * current priority of the thread in the intuitive sense of priority. */ RTEMS_INLINE_ROUTINE void _Scheduler_Change_priority_if_higher( - Scheduler_Control *scheduler, - Thread_Control *the_thread, - Priority_Control priority, - bool prepend_it + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + Priority_Control priority, + bool prepend_it ) { Priority_Control current = the_thread->current_priority; @@ -402,13 +409,13 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Change_priority_if_higher( } } -RTEMS_INLINE_ROUTINE Scheduler_Control *_Scheduler_Get( +RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get( Thread_Control *the_thread ) { (void) the_thread; - return &_Scheduler; + return &_Scheduler_Table[ 0 ]; } /** @} */ diff --git a/cpukit/score/include/rtems/score/schedulerpriority.h b/cpukit/score/include/rtems/score/schedulerpriority.h index 1e4e91ba32..7706bf32ce 100644 --- a/cpukit/score/include/rtems/score/schedulerpriority.h +++ b/cpukit/score/include/rtems/score/schedulerpriority.h @@ -66,6 +66,11 @@ extern "C" { } typedef struct { + /** + * @brief Basic scheduler context. + */ + Scheduler_Context Base; + /** * @brief Bit map to indicate non-empty ready queues. */ @@ -74,8 +79,8 @@ typedef struct { /** * @brief One ready queue per priority level. */ - Chain_Control Ready[ 1 ]; -} Scheduler_priority_Control; + Chain_Control Ready[ 0 ]; +} Scheduler_priority_Context; /** * Per-thread data related to the _Scheduler_PRIORITY scheduling policy. @@ -92,7 +97,7 @@ typedef struct { * @brief Initializes the priority scheduler. * This routine initializes the priority scheduler. */ -void _Scheduler_priority_Initialize(void); +void _Scheduler_priority_Initialize( const Scheduler_Control *scheduler ); /** * @brief Removes @a the_thread from the scheduling decision. @@ -105,8 +110,8 @@ void _Scheduler_priority_Initialize(void); * @param[in] the_thread is the thread to be blocked */ void _Scheduler_priority_Block( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -116,8 +121,8 @@ void _Scheduler_priority_Block( * by invoking the_scheduler->ready_queue->operations->first(). */ void _Scheduler_priority_Schedule( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -129,8 +134,8 @@ void _Scheduler_priority_Schedule( * management memory for */ void * _Scheduler_priority_Allocate( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -142,8 +147,8 @@ void * _Scheduler_priority_Allocate( * will be deallocated. */ void _Scheduler_priority_Free( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -155,8 +160,8 @@ void _Scheduler_priority_Free( * structure updated. */ void _Scheduler_priority_Update( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -169,8 +174,8 @@ void _Scheduler_priority_Update( * @param[in] the_thread will be unblocked */ void _Scheduler_priority_Unblock( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -193,8 +198,8 @@ void _Scheduler_priority_Unblock( * @param[in,out] thread The yielding thread. */ void _Scheduler_priority_Yield( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -205,8 +210,8 @@ void _Scheduler_priority_Yield( * @param[in] the_thread will be enqueued at the TAIL of its priority. */ void _Scheduler_priority_Enqueue( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -219,8 +224,8 @@ void _Scheduler_priority_Enqueue( * @param[in] the_thread will be enqueued at the HEAD of its priority. */ void _Scheduler_priority_Enqueue_first( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -232,8 +237,8 @@ void _Scheduler_priority_Enqueue_first( * @param[in] the_thread will be extracted from the ready set. */ void _Scheduler_priority_Extract( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** diff --git a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h index 9716b128ff..54fca12bf0 100644 --- a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h +++ b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h @@ -78,8 +78,8 @@ extern "C" { * management memory for. */ void * _Scheduler_priority_affinity_SMP_Allocate( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -94,10 +94,10 @@ void * _Scheduler_priority_affinity_SMP_Allocate( * @retval -1 The cpusetsize is invalid for the system */ bool _Scheduler_priority_affinity_SMP_Get_affinity( - Scheduler_Control *scheduler, - Thread_Control *thread, - size_t cpusetsize, - cpu_set_t *cpuset + const Scheduler_Control *scheduler, + Thread_Control *thread, + size_t cpusetsize, + cpu_set_t *cpuset ); /** @@ -111,10 +111,10 @@ bool _Scheduler_priority_affinity_SMP_Get_affinity( * @retval 0 Successful */ bool _Scheduler_priority_affinity_SMP_Set_affinity( - Scheduler_Control *scheduler, - Thread_Control *thread, - size_t cpusetsize, - cpu_set_t *cpuset + const Scheduler_Control *scheduler, + Thread_Control *thread, + size_t cpusetsize, + cpu_set_t *cpuset ); /** diff --git a/cpukit/score/include/rtems/score/schedulerpriorityimpl.h b/cpukit/score/include/rtems/score/schedulerpriorityimpl.h index 7861df5c90..bdd7e6fc5f 100644 --- a/cpukit/score/include/rtems/score/schedulerpriorityimpl.h +++ b/cpukit/score/include/rtems/score/schedulerpriorityimpl.h @@ -35,10 +35,10 @@ extern "C" { */ /**@{**/ -RTEMS_INLINE_ROUTINE Scheduler_priority_Control * - _Scheduler_priority_Self_from_base( Scheduler_Control *scheduler_base ) +RTEMS_INLINE_ROUTINE Scheduler_priority_Context * + _Scheduler_priority_Get_context( const Scheduler_Control *scheduler ) { - return (Scheduler_priority_Control *) scheduler_base->information; + return (Scheduler_priority_Context *) scheduler->context; } /** @@ -134,14 +134,14 @@ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_extract( } RTEMS_INLINE_ROUTINE void _Scheduler_priority_Extract_body( - Scheduler_Control *scheduler_base, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ) { - Scheduler_priority_Control *scheduler = - _Scheduler_priority_Self_from_base( scheduler_base ); + Scheduler_priority_Context *context = + _Scheduler_priority_Get_context( scheduler ); - _Scheduler_priority_Ready_queue_extract( the_thread, &scheduler->Bit_map ); + _Scheduler_priority_Ready_queue_extract( the_thread, &context->Bit_map ); } /** @@ -193,16 +193,16 @@ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_requeue( * for priority-based scheduling. */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body( - Scheduler_Control *scheduler_base, - Thread_Control *the_thread, - bool force_dispatch + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + bool force_dispatch ) { - Scheduler_priority_Control *scheduler = - _Scheduler_priority_Self_from_base( scheduler_base ); + Scheduler_priority_Context *context = + _Scheduler_priority_Get_context( scheduler ); Thread_Control *heir = _Scheduler_priority_Ready_queue_first( - &scheduler->Bit_map, - &scheduler->Ready[ 0 ] + &context->Bit_map, + &context->Ready[ 0 ] ); ( void ) the_thread; diff --git a/cpukit/score/include/rtems/score/schedulerprioritysmp.h b/cpukit/score/include/rtems/score/schedulerprioritysmp.h index 905549d125..df8af184e3 100644 --- a/cpukit/score/include/rtems/score/schedulerprioritysmp.h +++ b/cpukit/score/include/rtems/score/schedulerprioritysmp.h @@ -47,6 +47,12 @@ extern "C" { * @{ */ +typedef struct { + Scheduler_SMP_Context Base; + Priority_bit_map_Control Bit_map; + Chain_Control Ready[ 0 ]; +} Scheduler_priority_SMP_Context; + /** * @brief Entry points for the Priority SMP Scheduler. */ @@ -71,45 +77,45 @@ extern "C" { _Scheduler_default_Set_affinity \ } -void _Scheduler_priority_SMP_Initialize( void ); +void _Scheduler_priority_SMP_Initialize( const Scheduler_Control *scheduler ); void _Scheduler_priority_SMP_Schedule( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread ); void _Scheduler_priority_SMP_Block( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread ); void _Scheduler_priority_SMP_Update( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread ); void _Scheduler_priority_SMP_Enqueue_fifo( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread ); void _Scheduler_priority_SMP_Enqueue_lifo( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread ); void _Scheduler_priority_SMP_Extract( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread ); void _Scheduler_priority_SMP_Yield( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread ); void _Scheduler_priority_SMP_Start_idle( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread, Per_CPU_Control *cpu ); diff --git a/cpukit/score/include/rtems/score/schedulersimple.h b/cpukit/score/include/rtems/score/schedulersimple.h index 889c5a79c6..213bbb2709 100644 --- a/cpukit/score/include/rtems/score/schedulersimple.h +++ b/cpukit/score/include/rtems/score/schedulersimple.h @@ -55,21 +55,26 @@ extern "C" { } /** - * @brief Simple scheduler control. + * @brief Simple scheduler context. */ typedef struct { + /** + * @brief Basic scheduler context. + */ + Scheduler_Context Base; + /** * @brief One ready queue for all ready threads. */ Chain_Control Ready; -} Scheduler_simple_Control; +} Scheduler_simple_Context; /** * @brief Initialize simple scheduler. * * This routine initializes the simple scheduler. */ -void _Scheduler_simple_Initialize( void ); +void _Scheduler_simple_Initialize( const Scheduler_Control *scheduler ); /** * This routine sets the heir thread to be the next ready thread @@ -77,8 +82,8 @@ void _Scheduler_simple_Initialize( void ); * information. */ void _Scheduler_simple_Schedule( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -98,8 +103,8 @@ void _Scheduler_simple_Schedule( * @param[in,out] thread The yielding thread. */ void _Scheduler_simple_Yield( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -113,8 +118,8 @@ void _Scheduler_simple_Yield( * @param[in] the_thread is the thread that is to be blocked */ void _Scheduler_simple_Block( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -127,8 +132,8 @@ void _Scheduler_simple_Block( * @param[in] the_thread is the thread that is to be unblocked */ void _Scheduler_simple_Unblock( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -140,8 +145,8 @@ void _Scheduler_simple_Unblock( * @param[in] the_thread is the thread to be blocked */ void _Scheduler_simple_Extract( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -152,8 +157,8 @@ void _Scheduler_simple_Extract( * @param[in] the_thread is the thread to be enqueued */ void _Scheduler_simple_Enqueue( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -166,8 +171,8 @@ void _Scheduler_simple_Enqueue( * @param[in] the_thread is the thread to be blocked */ void _Scheduler_simple_Enqueue_first( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -179,8 +184,8 @@ void _Scheduler_simple_Enqueue_first( * @param[in] the_thread - pointer to a thread control block */ void _Scheduler_simple_Ready_queue_enqueue( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /** @@ -193,8 +198,8 @@ void _Scheduler_simple_Ready_queue_enqueue( * @param[in] the_thread - pointer to a thread control block */ void _Scheduler_simple_Ready_queue_enqueue_first( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ); /**@}*/ diff --git a/cpukit/score/include/rtems/score/schedulersimpleimpl.h b/cpukit/score/include/rtems/score/schedulersimpleimpl.h index 8ad142f0b4..f436134fc4 100644 --- a/cpukit/score/include/rtems/score/schedulersimpleimpl.h +++ b/cpukit/score/include/rtems/score/schedulersimpleimpl.h @@ -32,10 +32,10 @@ extern "C" { */ /**@{**/ -RTEMS_INLINE_ROUTINE Scheduler_simple_Control * - _Scheduler_simple_Self_from_base( Scheduler_Control *scheduler_base ) +RTEMS_INLINE_ROUTINE Scheduler_simple_Context * + _Scheduler_simple_Get_context( const Scheduler_Control *scheduler ) { - return (Scheduler_simple_Control *) scheduler_base->information; + return (Scheduler_simple_Context *) scheduler->context; } /** @@ -45,8 +45,8 @@ RTEMS_INLINE_ROUTINE Scheduler_simple_Control * * @param[in] the_thread is the thread to be blocked */ RTEMS_INLINE_ROUTINE void _Scheduler_simple_Ready_queue_requeue( - Scheduler_Control *scheduler, - Thread_Control *the_thread + const Scheduler_Control *scheduler, + Thread_Control *the_thread ) { /* extract */ @@ -103,14 +103,14 @@ RTEMS_INLINE_ROUTINE void _Scheduler_simple_Insert_priority_fifo( } RTEMS_INLINE_ROUTINE void _Scheduler_simple_Schedule_body( - Scheduler_Control *scheduler_base, - Thread_Control *the_thread, - bool force_dispatch + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + bool force_dispatch ) { - Scheduler_simple_Control *scheduler = - _Scheduler_simple_Self_from_base( scheduler_base ); - Thread_Control *heir = (Thread_Control *) _Chain_First( &scheduler->Ready ); + Scheduler_simple_Context *context = + _Scheduler_simple_Get_context( scheduler ); + Thread_Control *heir = (Thread_Control *) _Chain_First( &context->Ready ); ( void ) the_thread; diff --git a/cpukit/score/include/rtems/score/schedulersimplesmp.h b/cpukit/score/include/rtems/score/schedulersimplesmp.h index a6d826208d..dcdc6819a5 100644 --- a/cpukit/score/include/rtems/score/schedulersimplesmp.h +++ b/cpukit/score/include/rtems/score/schedulersimplesmp.h @@ -49,6 +49,11 @@ extern "C" { * @{ */ +typedef struct { + Scheduler_SMP_Context Base; + Chain_Control Ready; +} Scheduler_simple_SMP_Context; + /** * @brief Entry points for the Simple SMP Scheduler. */ @@ -73,40 +78,40 @@ extern "C" { _Scheduler_default_Set_affinity \ } -void _Scheduler_simple_smp_Initialize( void ); +void _Scheduler_simple_smp_Initialize( const Scheduler_Control *scheduler ); void _Scheduler_simple_smp_Block( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread ); void _Scheduler_simple_smp_Enqueue_priority_fifo( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread ); void _Scheduler_simple_smp_Enqueue_priority_lifo( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread ); void _Scheduler_simple_smp_Extract( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread ); void _Scheduler_simple_smp_Yield( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread ); void _Scheduler_simple_smp_Schedule( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread ); void _Scheduler_simple_smp_Start_idle( - Scheduler_Control *base, + const Scheduler_Control *scheduler, Thread_Control *thread, Per_CPU_Control *cpu ); diff --git a/cpukit/score/include/rtems/score/schedulersmp.h b/cpukit/score/include/rtems/score/schedulersmp.h index 458a31292f..8f5a390a26 100644 --- a/cpukit/score/include/rtems/score/schedulersmp.h +++ b/cpukit/score/include/rtems/score/schedulersmp.h @@ -41,19 +41,13 @@ extern "C" { */ typedef struct { - Chain_Control Scheduled; -} Scheduler_SMP_Control; - -typedef struct { - Scheduler_SMP_Control Base; - Chain_Control Ready; -} Scheduler_simple_SMP_Control; + /** + * @brief Basic scheduler context. + */ + Scheduler_Context Base; -typedef struct { - Scheduler_SMP_Control Base; - Priority_bit_map_Control Bit_map; - Chain_Control Ready[ 1 ]; -} Scheduler_priority_SMP_Control; + Chain_Control Scheduled; +} Scheduler_SMP_Context; /** @} */ diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h index df2a85b6f6..61fbff534f 100644 --- a/cpukit/score/include/rtems/score/schedulersmpimpl.h +++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h @@ -39,26 +39,26 @@ extern "C" { */ typedef Thread_Control *( *Scheduler_SMP_Get_highest_ready )( - Scheduler_SMP_Control *self + Scheduler_SMP_Context *self ); typedef void ( *Scheduler_SMP_Extract )( - Scheduler_SMP_Control *self, + Scheduler_SMP_Context *self, Thread_Control *thread ); typedef void ( *Scheduler_SMP_Insert )( - Scheduler_SMP_Control *self, + Scheduler_SMP_Context *self, Thread_Control *thread_to_insert ); typedef void ( *Scheduler_SMP_Move )( - Scheduler_SMP_Control *self, + Scheduler_SMP_Context *self, Thread_Control *thread_to_move ); static inline void _Scheduler_SMP_Initialize( - Scheduler_SMP_Control *self + Scheduler_SMP_Context *self ) { _Chain_Initialize_empty( &self->Scheduled ); @@ -107,7 +107,7 @@ static inline void _Scheduler_SMP_Allocate_processor( } static inline Thread_Control *_Scheduler_SMP_Get_lowest_scheduled( - Scheduler_SMP_Control *self + Scheduler_SMP_Context *self ) { Thread_Control *lowest_ready = NULL; @@ -121,7 +121,7 @@ static inline Thread_Control *_Scheduler_SMP_Get_lowest_scheduled( } static inline void _Scheduler_SMP_Enqueue_ordered( - Scheduler_SMP_Control *self, + Scheduler_SMP_Context *self, Thread_Control *thread, Chain_Node_order order, Scheduler_SMP_Get_highest_ready get_highest_ready, @@ -177,7 +177,7 @@ static inline void _Scheduler_SMP_Enqueue_ordered( } static inline void _Scheduler_SMP_Schedule_highest_ready( - Scheduler_SMP_Control *self, + Scheduler_SMP_Context *self, Thread_Control *victim, Scheduler_SMP_Get_highest_ready get_highest_ready, Scheduler_SMP_Move move_from_ready_to_scheduled @@ -191,7 +191,7 @@ static inline void _Scheduler_SMP_Schedule_highest_ready( } static inline void _Scheduler_SMP_Block( - Scheduler_SMP_Control *self, + Scheduler_SMP_Context *self, Thread_Control *thread, Scheduler_SMP_Extract extract, Scheduler_SMP_Get_highest_ready get_highest_ready, @@ -213,7 +213,7 @@ static inline void _Scheduler_SMP_Block( } static inline void _Scheduler_SMP_Extract( - Scheduler_SMP_Control *self, + Scheduler_SMP_Context *self, Thread_Control *thread, Scheduler_SMP_Extract extract ) @@ -222,7 +222,7 @@ static inline void _Scheduler_SMP_Extract( } static inline void _Scheduler_SMP_Schedule( - Scheduler_SMP_Control *self, + Scheduler_SMP_Context *self, Thread_Control *thread, Scheduler_SMP_Get_highest_ready get_highest_ready, Scheduler_SMP_Move move_from_ready_to_scheduled @@ -241,7 +241,7 @@ static inline void _Scheduler_SMP_Schedule( } static inline void _Scheduler_SMP_Insert_scheduled_lifo( - Scheduler_SMP_Control *self, + Scheduler_SMP_Context *self, Thread_Control *thread ) { @@ -253,7 +253,7 @@ static inline void _Scheduler_SMP_Insert_scheduled_lifo( } static inline void _Scheduler_SMP_Insert_scheduled_fifo( - Scheduler_SMP_Control *self, + Scheduler_SMP_Context *self, Thread_Control *thread ) { @@ -265,7 +265,7 @@ static inline void _Scheduler_SMP_Insert_scheduled_fifo( } static inline void _Scheduler_SMP_Start_idle( - Scheduler_SMP_Control *self, + Scheduler_SMP_Context *self, Thread_Control *thread, Per_CPU_Control *cpu ) -- cgit v1.2.3