summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/include/rtems/score')
-rw-r--r--cpukit/score/include/rtems/score/schedulerimpl.h6
-rw-r--r--cpukit/score/include/rtems/score/schedulersmpimpl.h2
-rw-r--r--cpukit/score/include/rtems/score/thread.h59
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h6
4 files changed, 42 insertions, 31 deletions
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index ad4c799375..364c658a1c 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -47,7 +47,7 @@ RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get(
)
{
#if defined(RTEMS_SMP)
- return the_thread->scheduler;
+ return the_thread->Scheduler.control;
#else
(void) the_thread;
@@ -375,7 +375,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Set(
if ( current_scheduler != scheduler ) {
_Thread_Set_state( the_thread, STATES_MIGRATING );
_Scheduler_Node_destroy( current_scheduler, the_thread );
- the_thread->scheduler = scheduler;
+ the_thread->Scheduler.control = scheduler;
_Scheduler_Node_initialize( scheduler, the_thread );
_Scheduler_Update_priority( the_thread, the_thread->current_priority );
_Thread_Clear_state( the_thread, STATES_MIGRATING );
@@ -649,7 +649,7 @@ RTEMS_INLINE_ROUTINE Scheduler_Node *_Scheduler_Node_get(
Thread_Control *the_thread
)
{
- return the_thread->scheduler_node;
+ return the_thread->Scheduler.node;
}
/** @} */
diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h
index 9d74434024..fd42f5a3c1 100644
--- a/cpukit/score/include/rtems/score/schedulersmpimpl.h
+++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h
@@ -420,7 +420,7 @@ static inline void _Scheduler_SMP_Allocate_processor(
_Scheduler_SMP_Update_heir( cpu_self, cpu_of_scheduled, scheduled );
} else {
/* We have to force a migration to our processor set */
- _Assert( scheduled->debug_real_cpu->heir != scheduled );
+ _Assert( scheduled->Scheduler.debug_real_cpu->heir != scheduled );
heir = scheduled;
}
} else {
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h
index 6ac4eccfbc..28844c3062 100644
--- a/cpukit/score/include/rtems/score/thread.h
+++ b/cpukit/score/include/rtems/score/thread.h
@@ -446,6 +446,38 @@ typedef struct {
} Thread_Life_control;
/**
+ * @brief Thread scheduler control.
+ */
+typedef struct {
+#if defined(RTEMS_SMP)
+ /**
+ * @brief The current scheduler control of this thread.
+ */
+ const struct Scheduler_Control *control;
+#endif
+
+ /**
+ * @brief The current scheduler node of this thread.
+ */
+ struct Scheduler_Node *node;
+
+#if defined(RTEMS_SMP)
+ /**
+ * @brief The processor assigned by the current scheduler.
+ */
+ Per_CPU_Control *cpu;
+
+#if defined(RTEMS_DEBUG)
+ /**
+ * @brief The processor on which this thread executed the last time or is
+ * executing.
+ */
+ Per_CPU_Control *debug_real_cpu;
+#endif
+#endif
+} Thread_Scheduler_control;
+
+/**
* This structure defines the Thread Control Block (TCB).
*/
struct Thread_Control_struct {
@@ -487,12 +519,11 @@ struct Thread_Control_struct {
#endif
/** This field is true if the thread is preemptible. */
bool is_preemptible;
-#if defined(RTEMS_SMP)
+
/**
- * @brief The scheduler of this thread.
+ * @brief Scheduler related control.
*/
- const struct Scheduler_Control *scheduler;
-#endif
+ Thread_Scheduler_control Scheduler;
#if __RTEMS_ADA__
/** This field is the GNAT self context pointer. */
@@ -515,26 +546,6 @@ struct Thread_Control_struct {
*/
Thread_CPU_usage_t cpu_time_used;
- /**
- * @brief The scheduler node of this thread for the real scheduler.
- */
- struct Scheduler_Node *scheduler_node;
-
-#ifdef RTEMS_SMP
- /**
- * @brief The processor assigned by the scheduler.
- */
- Per_CPU_Control *cpu;
-
-#ifdef RTEMS_DEBUG
- /**
- * @brief The processor on which this thread executed the last time or is
- * executing.
- */
- Per_CPU_Control *debug_real_cpu;
-#endif
-#endif
-
/** This field contains information about the starting state of
* this thread.
*/
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index 829e445ab8..b602b342de 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -408,7 +408,7 @@ RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Get_CPU(
)
{
#if defined(RTEMS_SMP)
- return thread->cpu;
+ return thread->Scheduler.cpu;
#else
(void) thread;
@@ -422,7 +422,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Set_CPU(
)
{
#if defined(RTEMS_SMP)
- thread->cpu = cpu;
+ thread->Scheduler.cpu = cpu;
#else
(void) thread;
(void) cpu;
@@ -804,7 +804,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Debug_set_real_processor(
)
{
#if defined(RTEMS_SMP) && defined(RTEMS_DEBUG)
- the_thread->debug_real_cpu = cpu;
+ the_thread->Scheduler.debug_real_cpu = cpu;
#else
(void) the_thread;
(void) cpu;