summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-10-31 08:33:11 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-02 10:05:45 +0100
commit2dd098a6359d9df132da09201ea0506c5389dc80 (patch)
tree0eb695dc9985894cf796d93ad1249344354f4863 /cpukit/score
parentscore: Delete Thread_Scheduler_control::own_node (diff)
downloadrtems-2dd098a6359d9df132da09201ea0506c5389dc80.tar.bz2
score: Introduce Thread_Scheduler_control::home
Replace Thread_Scheduler_control::control and Thread_Scheduler_control::own_control with new Thread_Scheduler_control::home. Update #2556.
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/include/rtems/score/coremuteximpl.h2
-rw-r--r--cpukit/score/include/rtems/score/mrspimpl.h2
-rw-r--r--cpukit/score/include/rtems/score/schedulerimpl.h45
-rw-r--r--cpukit/score/include/rtems/score/thread.h13
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h12
-rw-r--r--cpukit/score/src/sched.c2
-rw-r--r--cpukit/score/src/schedulergetaffinity.c2
-rw-r--r--cpukit/score/src/schedulersetaffinity.c2
-rw-r--r--cpukit/score/src/threadgetcputimeused.c2
-rw-r--r--cpukit/score/src/threadinitialize.c3
-rw-r--r--cpukit/score/src/threadrestart.c2
11 files changed, 31 insertions, 56 deletions
diff --git a/cpukit/score/include/rtems/score/coremuteximpl.h b/cpukit/score/include/rtems/score/coremuteximpl.h
index 5078c26c0a..bbe2f07a7e 100644
--- a/cpukit/score/include/rtems/score/coremuteximpl.h
+++ b/cpukit/score/include/rtems/score/coremuteximpl.h
@@ -332,7 +332,7 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_ceiling_mutex_Seize(
if ( owner == NULL ) {
#if defined(RTEMS_SMP)
if (
- _Scheduler_Get_own( executing )
+ _Thread_Scheduler_get_home( executing )
!= _CORE_ceiling_mutex_Get_scheduler( the_mutex )
) {
_CORE_mutex_Release( &the_mutex->Recursive.Mutex, queue_context );
diff --git a/cpukit/score/include/rtems/score/mrspimpl.h b/cpukit/score/include/rtems/score/mrspimpl.h
index 9555197672..96d88ad788 100644
--- a/cpukit/score/include/rtems/score/mrspimpl.h
+++ b/cpukit/score/include/rtems/score/mrspimpl.h
@@ -105,7 +105,7 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Raise_priority(
_Thread_queue_Context_clear_priority_updates( queue_context );
_Thread_Wait_acquire_default_critical( thread, &lock_context );
- scheduler = _Scheduler_Get_own( thread );
+ scheduler = _Thread_Scheduler_get_home( thread );
scheduler_node = _Thread_Scheduler_get_home_node( thread );
ceiling_priority = _MRSP_Get_priority( mrsp, scheduler );
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index acd5ba28f5..5ef60e646e 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -53,32 +53,6 @@ RTEMS_INLINE_ROUTINE Scheduler_Context *_Scheduler_Get_context(
return scheduler->context;
}
-RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get(
- const Thread_Control *the_thread
-)
-{
-#if defined(RTEMS_SMP)
- return the_thread->Scheduler.control;
-#else
- (void) the_thread;
-
- return &_Scheduler_Table[ 0 ];
-#endif
-}
-
-RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get_own(
- const Thread_Control *the_thread
-)
-{
-#if defined(RTEMS_SMP)
- return the_thread->Scheduler.own_control;
-#else
- (void) the_thread;
-
- return &_Scheduler_Table[ 0 ];
-#endif
-}
-
RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get_by_CPU_index(
uint32_t cpu_index
)
@@ -177,7 +151,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( Thread_Control *the_thread )
const Scheduler_Control *scheduler;
ISR_lock_Context lock_context;
- scheduler = _Scheduler_Get( the_thread );
+ scheduler = _Thread_Scheduler_get_home( the_thread );
_Scheduler_Acquire_critical( scheduler, &lock_context );
( *scheduler->Operations.schedule )( scheduler, the_thread );
@@ -246,7 +220,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( Thread_Control *the_thread )
#else
const Scheduler_Control *scheduler;
- scheduler = _Scheduler_Get( the_thread );
+ scheduler = _Thread_Scheduler_get_home( the_thread );
( *scheduler->Operations.yield )(
scheduler,
the_thread,
@@ -308,7 +282,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Block( Thread_Control *the_thread )
#else
const Scheduler_Control *scheduler;
- scheduler = _Scheduler_Get( the_thread );
+ scheduler = _Thread_Scheduler_get_home( the_thread );
( *scheduler->Operations.block )(
scheduler,
the_thread,
@@ -380,7 +354,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Unblock( Thread_Control *the_thread )
#else
const Scheduler_Control *scheduler;
- scheduler = _Scheduler_Get( the_thread );
+ scheduler = _Thread_Scheduler_get_home( the_thread );
( *scheduler->Operations.unblock )(
scheduler,
the_thread,
@@ -435,7 +409,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Update_priority( Thread_Control *the_thread
#else
const Scheduler_Control *scheduler;
- scheduler = _Scheduler_Get( the_thread );
+ scheduler = _Thread_Scheduler_get_home( the_thread );
( *scheduler->Operations.update_priority )(
scheduler,
the_thread,
@@ -601,7 +575,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Release_job(
Thread_queue_Context *queue_context
)
{
- const Scheduler_Control *scheduler = _Scheduler_Get( the_thread );
+ const Scheduler_Control *scheduler = _Thread_Scheduler_get_home( the_thread );
_Thread_queue_Context_clear_priority_updates( queue_context );
( *scheduler->Operations.release_job )(
@@ -627,7 +601,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Cancel_job(
Thread_queue_Context *queue_context
)
{
- const Scheduler_Control *scheduler = _Scheduler_Get( the_thread );
+ const Scheduler_Control *scheduler = _Thread_Scheduler_get_home( the_thread );
_Thread_queue_Context_clear_priority_updates( queue_context );
( *scheduler->Operations.cancel_job )(
@@ -1283,7 +1257,7 @@ RTEMS_INLINE_ROUTINE Status_Control _Scheduler_Set(
{
const Scheduler_Control *old_scheduler;
- old_scheduler = _Scheduler_Get( the_thread );
+ old_scheduler = _Thread_Scheduler_get_home( the_thread );
if ( old_scheduler != new_scheduler ) {
States_Control current_state;
@@ -1312,8 +1286,7 @@ RTEMS_INLINE_ROUTINE Status_Control _Scheduler_Set(
&new_scheduler_node->Thread.Scheduler_node.Chain
);
- the_thread->Scheduler.own_control = new_scheduler;
- the_thread->Scheduler.control = new_scheduler;
+ the_thread->Scheduler.home = new_scheduler;
_Scheduler_Node_set_priority( new_scheduler_node, priority, false );
if ( _States_Is_ready( current_state ) ) {
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h
index 37b978818e..ff7f13be55 100644
--- a/cpukit/score/include/rtems/score/thread.h
+++ b/cpukit/score/include/rtems/score/thread.h
@@ -255,18 +255,9 @@ typedef struct {
Thread_Scheduler_state state;
/**
- * @brief The own scheduler control of this thread.
- *
- * This field is constant after initialization.
- */
- const struct Scheduler_Control *own_control;
-
- /**
- * @brief The scheduler control of this thread.
- *
- * The scheduler helping protocol may change this field.
+ * @brief The home scheduler control of this thread.
*/
- const struct Scheduler_Control *control;
+ const struct Scheduler_Control *home;
/**
* @brief The processor assigned by the current scheduler.
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index 5bf45067c1..c7eef97254 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -1005,6 +1005,18 @@ RTEMS_INLINE_ROUTINE void _Thread_Scheduler_cancel_need_for_help(
}
#endif
+RTEMS_INLINE_ROUTINE const Scheduler_Control *_Thread_Scheduler_get_home(
+ const Thread_Control *the_thread
+)
+{
+#if defined(RTEMS_SMP)
+ return the_thread->Scheduler.home;
+#else
+ (void) the_thread;
+ return &_Scheduler_Table[ 0 ];
+#endif
+}
+
RTEMS_INLINE_ROUTINE Scheduler_Node *_Thread_Scheduler_get_home_node(
const Thread_Control *the_thread
)
diff --git a/cpukit/score/src/sched.c b/cpukit/score/src/sched.c
index e694564dca..36d3f0c915 100644
--- a/cpukit/score/src/sched.c
+++ b/cpukit/score/src/sched.c
@@ -31,7 +31,7 @@ int _Sched_Index( void )
{
Thread_Control *executing = _Thread_Get_executing();
- return (int) _Scheduler_Get_index( _Scheduler_Get( executing ) );
+ return (int) _Scheduler_Get_index( _Thread_Scheduler_get_home( executing ) );
}
int _Sched_Name_to_index( const char *name, size_t len )
diff --git a/cpukit/score/src/schedulergetaffinity.c b/cpukit/score/src/schedulergetaffinity.c
index c910a75d46..84899574b9 100644
--- a/cpukit/score/src/schedulergetaffinity.c
+++ b/cpukit/score/src/schedulergetaffinity.c
@@ -34,7 +34,7 @@ bool _Scheduler_Get_affinity(
return false;
}
- scheduler = _Scheduler_Get( the_thread );
+ scheduler = _Thread_Scheduler_get_home( the_thread );
_Scheduler_Acquire_critical( scheduler, &lock_context );
#if defined(RTEMS_SMP)
diff --git a/cpukit/score/src/schedulersetaffinity.c b/cpukit/score/src/schedulersetaffinity.c
index b59d8eb68e..6635ffa85f 100644
--- a/cpukit/score/src/schedulersetaffinity.c
+++ b/cpukit/score/src/schedulersetaffinity.c
@@ -34,7 +34,7 @@ bool _Scheduler_Set_affinity(
return false;
}
- scheduler = _Scheduler_Get( the_thread );
+ scheduler = _Thread_Scheduler_get_home( the_thread );
_Scheduler_Acquire_critical( scheduler, &lock_context );
#if defined(RTEMS_SMP)
diff --git a/cpukit/score/src/threadgetcputimeused.c b/cpukit/score/src/threadgetcputimeused.c
index 9026007cf0..7b5b73bf95 100644
--- a/cpukit/score/src/threadgetcputimeused.c
+++ b/cpukit/score/src/threadgetcputimeused.c
@@ -38,7 +38,7 @@ void _Thread_Get_CPU_time_used(
ISR_lock_Context scheduler_lock_context;
_Thread_State_acquire( the_thread, &state_lock_context );
- scheduler = _Scheduler_Get( the_thread );
+ scheduler = _Thread_Scheduler_get_home( the_thread );
_Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
if ( _Thread_Is_scheduled( the_thread ) ) {
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index d34cb34313..16c225e929 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -232,8 +232,7 @@ bool _Thread_Initialize(
#if defined(RTEMS_SMP)
RTEMS_STATIC_ASSERT( THREAD_SCHEDULER_BLOCKED == 0, Scheduler_state );
- the_thread->Scheduler.own_control = scheduler;
- the_thread->Scheduler.control = scheduler;
+ the_thread->Scheduler.home = scheduler;
_ISR_lock_Initialize( &the_thread->Scheduler.Lock, "Thread Scheduler" );
_ISR_lock_Initialize( &the_thread->Wait.Lock.Default, "Thread Wait Default" );
_Thread_queue_Gate_open( &the_thread->Wait.Lock.Tranquilizer );
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index 08e3c804b6..4d9e2c93ea 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -169,7 +169,7 @@ static void _Thread_Free( Thread_Control *the_thread )
_User_extensions_Destroy_iterators( the_thread );
_ISR_lock_Destroy( &the_thread->Keys.Lock );
_Scheduler_Node_destroy(
- _Scheduler_Get( the_thread ),
+ _Thread_Scheduler_get_home( the_thread ),
_Thread_Scheduler_get_home_node( the_thread )
);
_ISR_lock_Destroy( &the_thread->Timer.Lock );