diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-06-11 11:03:25 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-06-23 09:13:00 +0200 |
commit | 2d36931823be8be0c0fdf839f941cf20dd755523 (patch) | |
tree | 49fb0dc77781c44b6f0e3f28e92208e6594144ea /cpukit/score/include/rtems/score/thread.h | |
parent | score: Remove scheduler parameter from most ops (diff) | |
download | rtems-2d36931823be8be0c0fdf839f941cf20dd755523.tar.bz2 |
score: Collect scheduler related fields in TCB
Add Thread_Scheduler_control to collect scheduler related fields of the
TCB.
Diffstat (limited to 'cpukit/score/include/rtems/score/thread.h')
-rw-r--r-- | cpukit/score/include/rtems/score/thread.h | 59 |
1 files changed, 35 insertions, 24 deletions
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. */ |