From 500a8e9c62dca9f62611ecca64857dadb2bc0557 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 28 Apr 2016 06:26:01 +0200 Subject: score: Delete __RTEMS_STRICT_ORDER_MUTEX__ Remove support for strict order mutexes. Close #2124. --- cpukit/score/include/rtems/score/coremutex.h | 25 ----------- cpukit/score/include/rtems/score/coremuteximpl.h | 14 ------ cpukit/score/include/rtems/score/thread.h | 6 --- cpukit/score/src/coremutex.c | 6 --- cpukit/score/src/coremutexsurrender.c | 55 ------------------------ cpukit/score/src/threadinitialize.c | 5 --- 6 files changed, 111 deletions(-) (limited to 'cpukit/score') diff --git a/cpukit/score/include/rtems/score/coremutex.h b/cpukit/score/include/rtems/score/coremutex.h index c9b30dd956..41f1c4f22d 100644 --- a/cpukit/score/include/rtems/score/coremutex.h +++ b/cpukit/score/include/rtems/score/coremutex.h @@ -121,26 +121,6 @@ typedef struct { Priority_Control priority_ceiling; } CORE_mutex_Attributes; -#ifdef __RTEMS_STRICT_ORDER_MUTEX__ -/** - * @brief The control block to manage lock chain of priority inheritance mutex. - * - * The following defines the control block used to manage lock chain of - * priority inheritance mutex. - */ - typedef struct{ - /** This field is a chian of locked mutex by a thread,new mutex will - * be added to the head of queue, and the mutex which will be released - * must be the head of queue. - */ - Chain_Node lock_queue; - /** This field is the priority of thread before locking this mutex - * - */ - Priority_Control priority_before; - } CORE_mutex_order_list; -#endif - /** * @brief Control block used to manage each mutex. * @@ -170,11 +150,6 @@ typedef struct { * has not unlocked it. If the thread is not locked, there is no holder. */ Thread_Control *holder; -#ifdef __RTEMS_STRICT_ORDER_MUTEX__ - /** This field is used to manipulate the priority inheritance mutex queue*/ - CORE_mutex_order_list queue; -#endif - } CORE_mutex_Control; /**@}*/ diff --git a/cpukit/score/include/rtems/score/coremuteximpl.h b/cpukit/score/include/rtems/score/coremuteximpl.h index 4b144e8836..69935b5af3 100644 --- a/cpukit/score/include/rtems/score/coremuteximpl.h +++ b/cpukit/score/include/rtems/score/coremuteximpl.h @@ -66,13 +66,6 @@ typedef enum { */ CORE_MUTEX_TIMEOUT, -#if defined(__RTEMS_STRICT_ORDER_MUTEX__) - /** This status indicates that a thread not release the mutex which has - * the priority inheritance property in a right order. - */ - CORE_MUTEX_RELEASE_NOT_ORDER, -#endif - /** This status indicates that a thread of logically greater importance * than the ceiling priority attempted to lock this mutex. */ @@ -489,13 +482,6 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body( the_mutex->nest_count = 1; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ){ - -#ifdef __RTEMS_STRICT_ORDER_MUTEX__ - _Chain_Prepend_unprotected( &executing->lock_mutex, - &the_mutex->queue.lock_queue ); - the_mutex->queue.priority_before = executing->current_priority; -#endif - executing->resource_count++; } diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 4da4a341d6..8bc12d2e33 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -808,12 +808,6 @@ struct _Thread_Control { SMP_lock_Stats Potpourri_stats; #endif -#ifdef __RTEMS_STRICT_ORDER_MUTEX__ - /** This field is the head of queue of priority inheritance mutex - * held by the thread. - */ - Chain_Control lock_mutex; -#endif #if defined(RTEMS_SMP) /** * @brief Resource node to build a dependency tree in case this thread owns diff --git a/cpukit/score/src/coremutex.c b/cpukit/score/src/coremutex.c index 75e0c49592..8fc3a406d9 100644 --- a/cpukit/score/src/coremutex.c +++ b/cpukit/score/src/coremutex.c @@ -67,12 +67,6 @@ CORE_mutex_Status _CORE_mutex_Initialize( return CORE_MUTEX_STATUS_CEILING_VIOLATED; } -#ifdef __RTEMS_STRICT_ORDER_MUTEX__ - _Chain_Prepend_unprotected( &executing->lock_mutex, - &the_mutex->queue.lock_queue ); - the_mutex->queue.priority_before = executing->current_priority; -#endif - executing->resource_count++; if ( is_priority_ceiling ) { diff --git a/cpukit/score/src/coremutexsurrender.c b/cpukit/score/src/coremutexsurrender.c index 1858f9c311..cf6f0968b6 100644 --- a/cpukit/score/src/coremutexsurrender.c +++ b/cpukit/score/src/coremutexsurrender.c @@ -23,51 +23,6 @@ #include #include -#ifdef __RTEMS_STRICT_ORDER_MUTEX__ - static inline void _CORE_mutex_Push_priority( - CORE_mutex_Control *mutex, - Thread_Control *thread - ) - { - _Chain_Prepend_unprotected( - &thread->lock_mutex, - &mutex->queue.lock_queue - ); - mutex->queue.priority_before = thread->current_priority; - } - - static inline CORE_mutex_Status _CORE_mutex_Pop_priority( - CORE_mutex_Control *mutex, - Thread_Control *holder - ) - { - /* - * Check whether the holder release the mutex in LIFO order if not return - * error code. - */ - if ( _Chain_First( &holder->lock_mutex ) != &mutex->queue.lock_queue ) { - mutex->nest_count++; - - return CORE_MUTEX_RELEASE_NOT_ORDER; - } - - /* - * This pops the first node from the list. - */ - _Chain_Get_first_unprotected( &holder->lock_mutex ); - - if ( mutex->queue.priority_before != holder->current_priority ) - _Thread_Change_priority( holder, mutex->queue.priority_before, true ); - - return CORE_MUTEX_STATUS_SUCCESSFUL; - } -#else - #define _CORE_mutex_Push_priority( mutex, thread ) ((void) 0) - - #define _CORE_mutex_Pop_priority( mutex, thread ) \ - CORE_MUTEX_STATUS_SUCCESSFUL -#endif - CORE_mutex_Status _CORE_mutex_Do_surrender( CORE_mutex_Control *the_mutex, #if defined(RTEMS_MULTIPROCESSING) @@ -142,14 +97,6 @@ CORE_mutex_Status _CORE_mutex_Do_surrender( */ if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { - CORE_mutex_Status pop_status = - _CORE_mutex_Pop_priority( the_mutex, holder ); - - if ( pop_status != CORE_MUTEX_STATUS_SUCCESSFUL ) { - _Thread_queue_Release( &the_mutex->Wait_queue, lock_context ); - return pop_status; - } - holder->resource_count--; } the_mutex->holder = NULL; @@ -193,12 +140,10 @@ CORE_mutex_Status _CORE_mutex_Do_surrender( case CORE_MUTEX_DISCIPLINES_PRIORITY: break; case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT: - _CORE_mutex_Push_priority( the_mutex, the_thread ); the_thread->resource_count++; _Thread_queue_Boost_priority( &the_mutex->Wait_queue.Queue, the_thread ); break; case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING: - _CORE_mutex_Push_priority( the_mutex, the_thread ); the_thread->resource_count++; _Thread_Raise_priority( the_thread, diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c index 18d29f8d1a..c3e6469679 100644 --- a/cpukit/score/src/threadinitialize.c +++ b/cpukit/score/src/threadinitialize.c @@ -145,11 +145,6 @@ bool _Thread_Initialize( } _Thread_queue_Heads_initialize( the_thread->Wait.spare_heads ); - #ifdef __RTEMS_STRICT_ORDER_MUTEX__ - /* Initialize the head of chain of held mutexes */ - _Chain_Initialize_empty(&the_thread->lock_mutex); - #endif - /* * General initialization */ -- cgit v1.2.3