From 78b867e26dac3266763f275c1f438da912f33a6e Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Thu, 21 Dec 2017 11:49:30 -0500 Subject: score: replace current and real priority with priority node Encapsulate the current_priority and real_priority fields of the thread control block with a Thread_Priority_node struct. Propagate modifications throughout the tree where the two fields are directly accessed. Updates #3359. --- cpukit/score/include/rtems/score/thread.h | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'cpukit/score/include/rtems/score/thread.h') diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 214f8ce1f5..b0b40f713c 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -276,6 +276,17 @@ typedef struct { Thread_queue_Control *queue; } Thread_Wait_information; +/** + * @brief Encapsulates base and inherited priority. + */ +typedef struct Thread_Priority_node { + Chain_Node Node; + /** current priority = min(real_priority, min(Inherited_priorities)) */ + Priority_Control current_priority; + /** base priority irrespective of inheritance/ceiling */ + Priority_Control real_priority; +} Thread_Priority_node; + /** * The following defines the control block used to manage * each thread proxy. @@ -288,10 +299,9 @@ typedef struct { Objects_Control Object; /** This field is the current execution state of this proxy. */ States_Control current_state; - /** This field is the current priority state of this proxy. */ - Priority_Control current_priority; - /** This field is the base priority of this proxy. */ - Priority_Control real_priority; + /** This field encapsulates the base and current (inherited) priority + * of this proxy. */ + Thread_Priority_node Priority_node; /** This field is the number of mutexes currently held by this proxy. */ uint32_t resource_count; @@ -338,10 +348,9 @@ struct Thread_Control_struct { Objects_Control Object; /** This field is the current execution state of this thread. */ States_Control current_state; - /** This field is the current priority state of this thread. */ - Priority_Control current_priority; - /** This field is the base priority of this thread. */ - Priority_Control real_priority; + /** This field encapsulates the base and current (inherited) priority + * of this thread. */ + Thread_Priority_node Priority_node; /** This field is the number of mutexes currently held by this thread. */ uint32_t resource_count; /** This field is the blocking information for this thread. */ -- cgit v1.2.3