diff options
Diffstat (limited to 'cpukit/score/include')
-rw-r--r-- | cpukit/score/include/rtems/score/coremuteximpl.h | 3 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/threadimpl.h | 31 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/threadq.h | 9 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/threadqimpl.h | 23 |
4 files changed, 34 insertions, 32 deletions
diff --git a/cpukit/score/include/rtems/score/coremuteximpl.h b/cpukit/score/include/rtems/score/coremuteximpl.h index 339834bc37..f48524a7b6 100644 --- a/cpukit/score/include/rtems/score/coremuteximpl.h +++ b/cpukit/score/include/rtems/score/coremuteximpl.h @@ -36,6 +36,9 @@ extern "C" { #define CORE_MUTEX_TQ_OPERATIONS &_Thread_queue_Operations_priority +#define CORE_MUTEX_TQ_PRIORITY_INHERIT_OPERATIONS \ + &_Thread_queue_Operations_priority_inherit + RTEMS_INLINE_ROUTINE void _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex ) diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h index 5323e2c85b..92968a2e8e 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -512,37 +512,6 @@ void _Thread_Raise_priority( ); /** - * @brief Inherit the priority of a thread. - * - * It changes the current priority of the inheritor thread to the current priority - * of the ancestor thread if it is higher than the current priority of the inheritor - * thread. In this case the inheritor thread is appended to its new priority group - * in its scheduler instance. - * - * On SMP configurations, the priority is changed to PRIORITY_PSEUDO_ISR in - * case the own schedulers of the inheritor and ancestor thread differ (priority - * boosting). - * - * @param[in] inheritor The thread to inherit the priority. - * @param[in] ancestor The thread to bequeath its priority to the inheritor - * thread. - */ -#if defined(RTEMS_SMP) -void _Thread_Inherit_priority( - Thread_Control *inheritor, - Thread_Control *ancestor -); -#else -RTEMS_INLINE_ROUTINE void _Thread_Inherit_priority( - Thread_Control *inheritor, - Thread_Control *ancestor -) -{ - _Thread_Raise_priority( inheritor, ancestor->current_priority ); -} -#endif - -/** * @brief Sets the current to the real priority of a thread. * * Sets the priority restore hint to false. diff --git a/cpukit/score/include/rtems/score/threadq.h b/cpukit/score/include/rtems/score/threadq.h index b3b8fec980..75aab20993 100644 --- a/cpukit/score/include/rtems/score/threadq.h +++ b/cpukit/score/include/rtems/score/threadq.h @@ -43,6 +43,8 @@ extern "C" { typedef struct _Thread_Control Thread_Control; +typedef struct Thread_queue_Path Thread_queue_Path; + #if defined(RTEMS_MULTIPROCESSING) /** * @brief Multiprocessing (MP) support callout for thread queue operations. @@ -239,6 +241,10 @@ typedef void ( *Thread_queue_Priority_change_operation )( /** * @brief Thread queue enqueue operation. * + * A potential thread to update the priority due to priority inheritance is + * returned via the thread queue path. This thread is handed over to + * _Thread_Update_priority(). + * * @param[in] queue The actual thread queue. * @param[in] the_thread The thread to enqueue on the queue. * @@ -246,7 +252,8 @@ typedef void ( *Thread_queue_Priority_change_operation )( */ typedef void ( *Thread_queue_Enqueue_operation )( Thread_queue_Queue *queue, - Thread_Control *the_thread + Thread_Control *the_thread, + Thread_queue_Path *path ); /** diff --git a/cpukit/score/include/rtems/score/threadqimpl.h b/cpukit/score/include/rtems/score/threadqimpl.h index e7db7bb6c0..1f17f1a4f1 100644 --- a/cpukit/score/include/rtems/score/threadqimpl.h +++ b/cpukit/score/include/rtems/score/threadqimpl.h @@ -36,6 +36,27 @@ extern "C" { /**@{*/ /** + * @brief Representation of a thread queue path from a start thread queue to + * the terminal thread queue. + * + * The start thread queue is determined by the object on which a thread intends + * to block. The terminal thread queue is the thread queue reachable via + * thread queue links those owner is not blocked on a thread queue. The thread + * queue links are determined by the thread queue owner and thread wait queue + * relationships. + */ +struct Thread_queue_Path { + /** + * @brief A potential thread to update the priority via + * _Thread_Update_priority(). + * + * This thread is determined by thread queues which support priority + * inheritance. + */ + Thread_Control *update_priority; +}; + +/** * @brief Thread queue with a layout compatible to struct _Thread_queue_Queue * defined in Newlib <sys/lock.h>. */ @@ -888,6 +909,8 @@ extern const Thread_queue_Operations _Thread_queue_Operations_FIFO; extern const Thread_queue_Operations _Thread_queue_Operations_priority; +extern const Thread_queue_Operations _Thread_queue_Operations_priority_inherit; + /**@}*/ #ifdef __cplusplus |