forked from Imagelibrary/rtems
Rename __STRICT_ORDER_MUTEX__ to __RTEMS_STRICT_ORDER_MUTEX__.
This commit is contained in:
@@ -221,7 +221,7 @@ RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__],
|
|||||||
[disable inlining _Thread_Enable_dispatch])
|
[disable inlining _Thread_Enable_dispatch])
|
||||||
|
|
||||||
## This gives the same behavior as 4.8 and older
|
## This gives the same behavior as 4.8 and older
|
||||||
RTEMS_CPUOPT([__STRICT_ORDER_MUTEX__],
|
RTEMS_CPUOPT([__RTEMS_STRICT_ORDER_MUTEX__],
|
||||||
[test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
|
[test x"${ENABLE_STRICT_ORDER_MUTEX}" = x"1"],
|
||||||
[1],
|
[1],
|
||||||
[disable strict order mutex])
|
[disable strict order mutex])
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ const rtems_status_code _Semaphore_Translate_core_mutex_return_code_[] = {
|
|||||||
RTEMS_NOT_OWNER_OF_RESOURCE, /* CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE */
|
RTEMS_NOT_OWNER_OF_RESOURCE, /* CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE */
|
||||||
RTEMS_OBJECT_WAS_DELETED, /* CORE_MUTEX_WAS_DELETED */
|
RTEMS_OBJECT_WAS_DELETED, /* CORE_MUTEX_WAS_DELETED */
|
||||||
RTEMS_TIMEOUT, /* CORE_MUTEX_TIMEOUT */
|
RTEMS_TIMEOUT, /* CORE_MUTEX_TIMEOUT */
|
||||||
#ifdef __STRICT_ORDER_MUTEX__
|
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||||
CORE_MUTEX_RELEASE_NOT_ORDER,
|
CORE_MUTEX_RELEASE_NOT_ORDER,
|
||||||
#endif
|
#endif
|
||||||
RTEMS_INTERNAL_ERROR /* CORE_MUTEX_STATUS_CEILING_VIOLATED */
|
RTEMS_INTERNAL_ERROR /* CORE_MUTEX_STATUS_CEILING_VIOLATED */
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
CORE_MUTEX_TIMEOUT,
|
CORE_MUTEX_TIMEOUT,
|
||||||
|
|
||||||
#ifdef __STRICT_ORDER_MUTEX__
|
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||||
/** This status indicates that a thread not release the mutex which has
|
/** This status indicates that a thread not release the mutex which has
|
||||||
* the priority inheritance property in a right order.
|
* the priority inheritance property in a right order.
|
||||||
*/
|
*/
|
||||||
@@ -193,7 +193,7 @@ typedef struct {
|
|||||||
Priority_Control priority_ceiling;
|
Priority_Control priority_ceiling;
|
||||||
} CORE_mutex_Attributes;
|
} CORE_mutex_Attributes;
|
||||||
|
|
||||||
#ifdef __STRICT_ORDER_MUTEX__
|
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||||
/*@beief Core Mutex Lock_Chain Struct
|
/*@beief Core Mutex Lock_Chain Struct
|
||||||
*
|
*
|
||||||
* The following defines the control block used to manage lock chain of
|
* The following defines the control block used to manage lock chain of
|
||||||
@@ -242,7 +242,7 @@ typedef struct {
|
|||||||
Thread_Control *holder;
|
Thread_Control *holder;
|
||||||
/** This element contains the object Id of the holding thread. */
|
/** This element contains the object Id of the holding thread. */
|
||||||
Objects_Id holder_id;
|
Objects_Id holder_id;
|
||||||
#ifdef __STRICT_ORDER_MUTEX__
|
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||||
/** This field is used to manipulate the priority inheritance mutex queue*/
|
/** This field is used to manipulate the priority inheritance mutex queue*/
|
||||||
CORE_mutex_order_list queue;
|
CORE_mutex_order_list queue;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ struct Thread_Control_struct {
|
|||||||
/** This field is the received response packet in an MP system. */
|
/** This field is the received response packet in an MP system. */
|
||||||
MP_packet_Prefix *receive_packet;
|
MP_packet_Prefix *receive_packet;
|
||||||
#endif
|
#endif
|
||||||
#ifdef __STRICT_ORDER_MUTEX__
|
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||||
/**This field is the head of queue of priority inheritance mutex holed by the thread*/
|
/**This field is the head of queue of priority inheritance mutex holed by the thread*/
|
||||||
Chain_Control lock_mutex;
|
Chain_Control lock_mutex;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
|
|||||||
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
|
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
|
||||||
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ){
|
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ){
|
||||||
|
|
||||||
#ifdef __STRICT_ORDER_MUTEX__
|
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||||
_Chain_Prepend_unprotected( &executing->lock_mutex,
|
_Chain_Prepend_unprotected( &executing->lock_mutex,
|
||||||
&the_mutex->queue.lock_queue );
|
&the_mutex->queue.lock_queue );
|
||||||
the_mutex->queue.priority_before = executing->current_priority;
|
the_mutex->queue.priority_before = executing->current_priority;
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ void _CORE_mutex_Initialize(
|
|||||||
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
|
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
|
||||||
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) )
|
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) )
|
||||||
|
|
||||||
#ifdef __STRICT_ORDER_MUTEX__
|
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||||
_Chain_Prepend_unprotected( &executing->lock_mutex,
|
_Chain_Prepend_unprotected( &executing->lock_mutex,
|
||||||
&the_mutex->queue.lock_queue );
|
&the_mutex->queue.lock_queue );
|
||||||
the_mutex->queue.priority_before = executing->current_priority;
|
the_mutex->queue.priority_before = executing->current_priority;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ CORE_mutex_Status _CORE_mutex_Surrender(
|
|||||||
{
|
{
|
||||||
Thread_Control *the_thread;
|
Thread_Control *the_thread;
|
||||||
Thread_Control *holder;
|
Thread_Control *holder;
|
||||||
#ifdef __STRICT_ORDER_MUTEX__
|
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||||
Chain_Node *first_node;
|
Chain_Node *first_node;
|
||||||
#endif
|
#endif
|
||||||
holder = the_mutex->holder;
|
holder = the_mutex->holder;
|
||||||
@@ -98,7 +98,7 @@ CORE_mutex_Status _CORE_mutex_Surrender(
|
|||||||
*/
|
*/
|
||||||
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
|
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
|
||||||
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ){
|
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ){
|
||||||
#ifdef __STRICT_ORDER_MUTEX__
|
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||||
/*Check whether the holder release the mutex in LIFO order
|
/*Check whether the holder release the mutex in LIFO order
|
||||||
if not return error code*/
|
if not return error code*/
|
||||||
if(holder->lock_mutex.first != &the_mutex->queue.lock_queue){
|
if(holder->lock_mutex.first != &the_mutex->queue.lock_queue){
|
||||||
@@ -119,7 +119,7 @@ CORE_mutex_Status _CORE_mutex_Surrender(
|
|||||||
*/
|
*/
|
||||||
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
|
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
|
||||||
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
|
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
|
||||||
#ifdef __STRICT_ORDER_MUTEX__
|
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||||
if(the_mutex->queue.priority_before != holder->current_priority)
|
if(the_mutex->queue.priority_before != holder->current_priority)
|
||||||
_Thread_Change_priority(holder,the_mutex->queue.priority_before,TRUE);
|
_Thread_Change_priority(holder,the_mutex->queue.priority_before,TRUE);
|
||||||
#endif
|
#endif
|
||||||
@@ -157,14 +157,14 @@ CORE_mutex_Status _CORE_mutex_Surrender(
|
|||||||
case CORE_MUTEX_DISCIPLINES_PRIORITY:
|
case CORE_MUTEX_DISCIPLINES_PRIORITY:
|
||||||
break;
|
break;
|
||||||
case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
|
case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
|
||||||
#ifdef __STRICT_ORDER_MUTEX__
|
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||||
_Chain_Prepend_unprotected(&the_thread->lock_mutex,&the_mutex->queue.lock_queue);
|
_Chain_Prepend_unprotected(&the_thread->lock_mutex,&the_mutex->queue.lock_queue);
|
||||||
the_mutex->queue.priority_before = the_thread->current_priority;
|
the_mutex->queue.priority_before = the_thread->current_priority;
|
||||||
#endif
|
#endif
|
||||||
the_thread->resource_count++;
|
the_thread->resource_count++;
|
||||||
break;
|
break;
|
||||||
case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
|
case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
|
||||||
#ifdef __STRICT_ORDER_MUTEX__
|
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||||
_Chain_Prepend_unprotected(&the_thread->lock_mutex,&the_mutex->queue.lock_queue);
|
_Chain_Prepend_unprotected(&the_thread->lock_mutex,&the_mutex->queue.lock_queue);
|
||||||
the_mutex->queue.priority_before = the_thread->current_priority;
|
the_mutex->queue.priority_before = the_thread->current_priority;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ boolean _Thread_Initialize(
|
|||||||
*/
|
*/
|
||||||
_Watchdog_Initialize( &the_thread->Timer, NULL, 0, NULL );
|
_Watchdog_Initialize( &the_thread->Timer, NULL, 0, NULL );
|
||||||
|
|
||||||
#ifdef __STRICT_ORDER_MUTEX__
|
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||||
/*Initialize the head of chain of mutex */
|
/*Initialize the head of chain of mutex */
|
||||||
_Chain_Initialize_empty(&the_thread->lock_mutex);
|
_Chain_Initialize_empty(&the_thread->lock_mutex);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user