Changeset 500a8e9c in rtems


Ignore:
Timestamp:
Apr 28, 2016, 4:26:01 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
d5cc9fd6
Parents:
1ef8e4a8
git-author:
Sebastian Huber <sebastian.huber@…> (04/28/16 04:26:01)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/02/16 05:46:16)
Message:

score: Delete RTEMS_STRICT_ORDER_MUTEX

Remove support for strict order mutexes.

Close #2124.

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • cpukit/configure.ac

    r1ef8e4a8 r500a8e9c  
    272272  [1],
    273273  [disable inlining _Thread_Enable_dispatch])
    274 
    275 ## This gives the same behavior as 4.8 and older
    276 RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
    277   [test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
    278   [1],
    279   [disable strict order mutex])
    280274
    281275## Deactivate ada bindings
  • cpukit/posix/src/mutextranslatereturncode.c

    r1ef8e4a8 r500a8e9c  
    2828  EINVAL,                 /* CORE_MUTEX_WAS_DELETED */
    2929  ETIMEDOUT,              /* CORE_MUTEX_TIMEOUT */
    30 #ifdef __RTEMS_STRICT_ORDER_MUTEX__
    31   EDEADLK,                /* CORE_MUTEX_RELEASE_NOT_ORDER */
    32 #endif
    3330  EINVAL                  /* CORE_MUTEX_STATUS_CEILING_VIOLATED */
    3431};
  • cpukit/rtems/src/semtranslatereturncode.c

    r1ef8e4a8 r500a8e9c  
    3030  RTEMS_OBJECT_WAS_DELETED, /* CORE_MUTEX_WAS_DELETED */
    3131  RTEMS_TIMEOUT,            /* CORE_MUTEX_TIMEOUT */
    32 #if defined(__RTEMS_STRICT_ORDER_MUTEX__)
    33     123,
    34 #endif
    3532  RTEMS_INVALID_PRIORITY   /* CORE_MUTEX_STATUS_CEILING_VIOLATED */
    3633};
  • cpukit/score/include/rtems/score/coremutex.h

    r1ef8e4a8 r500a8e9c  
    122122}   CORE_mutex_Attributes;
    123123
    124 #ifdef __RTEMS_STRICT_ORDER_MUTEX__
    125 /**
    126  * @brief The control block to manage lock chain of priority inheritance mutex.
    127  *
    128  * The following defines the control block used to manage lock chain of
    129  * priority inheritance mutex.
    130  */
    131   typedef struct{
    132     /** This field is a chian of locked mutex by a thread,new mutex will
    133      *  be added to the head of queue, and the mutex which will be released
    134      *  must be the head of queue.
    135      */
    136     Chain_Node                lock_queue;
    137     /** This field is the priority of thread before locking this mutex
    138      *
    139      */
    140     Priority_Control          priority_before;
    141   }  CORE_mutex_order_list;
    142 #endif
    143 
    144124/**
    145125 *  @brief Control block used to manage each mutex.
     
    171151   */
    172152  Thread_Control         *holder;
    173 #ifdef __RTEMS_STRICT_ORDER_MUTEX__
    174   /** This field is used to manipulate the priority inheritance mutex queue*/
    175   CORE_mutex_order_list   queue;
    176 #endif
    177 
    178153}   CORE_mutex_Control;
    179154
  • cpukit/score/include/rtems/score/coremuteximpl.h

    r1ef8e4a8 r500a8e9c  
    6666   */
    6767  CORE_MUTEX_TIMEOUT,
    68 
    69 #if defined(__RTEMS_STRICT_ORDER_MUTEX__)
    70   /** This status indicates that a thread not release the mutex which has
    71    *  the priority inheritance property in a right order.
    72    */
    73   CORE_MUTEX_RELEASE_NOT_ORDER,
    74 #endif
    7568
    7669  /** This status indicates that a thread of logically greater importance
     
    490483    if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
    491484         _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ){
    492 
    493 #ifdef __RTEMS_STRICT_ORDER_MUTEX__
    494        _Chain_Prepend_unprotected( &executing->lock_mutex,
    495                                    &the_mutex->queue.lock_queue );
    496        the_mutex->queue.priority_before = executing->current_priority;
    497 #endif
    498 
    499485      executing->resource_count++;
    500486    }
  • cpukit/score/include/rtems/score/thread.h

    r1ef8e4a8 r500a8e9c  
    809809#endif
    810810
    811 #ifdef __RTEMS_STRICT_ORDER_MUTEX__
    812   /** This field is the head of queue of priority inheritance mutex
    813    *  held by the thread.
    814    */
    815   Chain_Control            lock_mutex;
    816 #endif
    817811#if defined(RTEMS_SMP)
    818812  /**
  • cpukit/score/src/coremutex.c

    r1ef8e4a8 r500a8e9c  
    6868      }
    6969
    70 #ifdef __RTEMS_STRICT_ORDER_MUTEX__
    71        _Chain_Prepend_unprotected( &executing->lock_mutex,
    72                                    &the_mutex->queue.lock_queue );
    73        the_mutex->queue.priority_before = executing->current_priority;
    74 #endif
    75 
    7670      executing->resource_count++;
    7771
  • cpukit/score/src/coremutexsurrender.c

    r1ef8e4a8 r500a8e9c  
    2323#include <rtems/score/coremuteximpl.h>
    2424#include <rtems/score/thread.h>
    25 
    26 #ifdef __RTEMS_STRICT_ORDER_MUTEX__
    27   static inline void _CORE_mutex_Push_priority(
    28     CORE_mutex_Control *mutex,
    29     Thread_Control *thread
    30   )
    31   {
    32     _Chain_Prepend_unprotected(
    33       &thread->lock_mutex,
    34       &mutex->queue.lock_queue
    35     );
    36     mutex->queue.priority_before = thread->current_priority;
    37   }
    38 
    39   static inline CORE_mutex_Status _CORE_mutex_Pop_priority(
    40     CORE_mutex_Control *mutex,
    41     Thread_Control *holder
    42   )
    43   {
    44     /*
    45      *  Check whether the holder release the mutex in LIFO order if not return
    46      *  error code.
    47      */
    48     if ( _Chain_First( &holder->lock_mutex ) != &mutex->queue.lock_queue ) {
    49       mutex->nest_count++;
    50 
    51       return CORE_MUTEX_RELEASE_NOT_ORDER;
    52     }
    53 
    54     /*
    55      *  This pops the first node from the list.
    56      */
    57     _Chain_Get_first_unprotected( &holder->lock_mutex );
    58 
    59     if ( mutex->queue.priority_before != holder->current_priority )
    60       _Thread_Change_priority( holder, mutex->queue.priority_before, true );
    61 
    62     return CORE_MUTEX_STATUS_SUCCESSFUL;
    63   }
    64 #else
    65   #define _CORE_mutex_Push_priority( mutex, thread ) ((void) 0)
    66 
    67   #define _CORE_mutex_Pop_priority( mutex, thread ) \
    68     CORE_MUTEX_STATUS_SUCCESSFUL
    69 #endif
    7025
    7126CORE_mutex_Status _CORE_mutex_Do_surrender(
     
    14398  if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
    14499       _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
    145     CORE_mutex_Status pop_status =
    146       _CORE_mutex_Pop_priority( the_mutex, holder );
    147 
    148     if ( pop_status != CORE_MUTEX_STATUS_SUCCESSFUL ) {
    149       _Thread_queue_Release( &the_mutex->Wait_queue, lock_context );
    150       return pop_status;
    151     }
    152 
    153100    holder->resource_count--;
    154101  }
     
    194141          break;
    195142        case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
    196           _CORE_mutex_Push_priority( the_mutex, the_thread );
    197143          the_thread->resource_count++;
    198144          _Thread_queue_Boost_priority( &the_mutex->Wait_queue.Queue, the_thread );
    199145          break;
    200146        case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
    201           _CORE_mutex_Push_priority( the_mutex, the_thread );
    202147          the_thread->resource_count++;
    203148          _Thread_Raise_priority(
  • cpukit/score/src/threadinitialize.c

    r1ef8e4a8 r500a8e9c  
    146146  _Thread_queue_Heads_initialize( the_thread->Wait.spare_heads );
    147147
    148   #ifdef __RTEMS_STRICT_ORDER_MUTEX__
    149     /* Initialize the head of chain of held mutexes */
    150     _Chain_Initialize_empty(&the_thread->lock_mutex);
    151   #endif
    152 
    153148  /*
    154149   *  General initialization
  • testsuites/sptests/sp36/strict_order_mut.c

    r1ef8e4a8 r500a8e9c  
    116116  printf("The current priority of T0 is %d\n",Get_current_pri());
    117117
    118 #ifdef __RTEMS_STRICT_ORDER_MUTEX__
    119   status = rtems_semaphore_release( Mutex_id[0] );
    120   printf("T0 - rtems_semaphore_release - S0\n");
    121   if(status == CORE_MUTEX_RELEASE_NOT_ORDER)
    122     printf("T0 releasing S0 not in order\n");
    123 #endif
    124 
    125118  status = rtems_semaphore_release(Mutex_id[1]);
    126119  printf("T0 - rtems_semaphore_release - S1\n");
Note: See TracChangeset for help on using the changeset viewer.