From dce487912d98835b8168e755b60514f5a8592b27 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 23 May 2016 13:37:59 +0200 Subject: score: Add Status_Control for all APIs Unify the status codes of the Classic and POSIX API to use the new enum Status_Control. This eliminates the Thread_Control::Wait::timeout_code field and the timeout parameter of _Thread_queue_Enqueue_critical() and _MPCI_Send_request_packet(). It gets rid of the status code translation tables and instead uses simple bit operations to get the status for a particular API. This enables translation of status code constants at compile time. Add _Thread_Wait_get_status() to avoid direct access of thread internal data structures. --- cpukit/score/src/coremutexsurrender.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'cpukit/score/src/coremutexsurrender.c') diff --git a/cpukit/score/src/coremutexsurrender.c b/cpukit/score/src/coremutexsurrender.c index 040a580592..1da98276bf 100644 --- a/cpukit/score/src/coremutexsurrender.c +++ b/cpukit/score/src/coremutexsurrender.c @@ -23,7 +23,7 @@ #include #include -CORE_mutex_Status _CORE_mutex_Surrender( +Status_Control _CORE_mutex_Surrender( CORE_mutex_Control *the_mutex, Thread_queue_Context *queue_context ) @@ -44,7 +44,7 @@ CORE_mutex_Status _CORE_mutex_Surrender( if ( the_mutex->Attributes.only_owner_release ) { if ( !_Thread_Is_executing( holder ) ) { _ISR_lock_ISR_enable( &queue_context->Lock_context ); - return CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE; + return STATUS_NOT_OWNER; } } @@ -54,7 +54,7 @@ CORE_mutex_Status _CORE_mutex_Surrender( if ( !the_mutex->nest_count ) { _CORE_mutex_Release( the_mutex, queue_context ); - return CORE_MUTEX_STATUS_SUCCESSFUL; + return STATUS_SUCCESSFUL; } the_mutex->nest_count--; @@ -69,12 +69,12 @@ CORE_mutex_Status _CORE_mutex_Surrender( switch ( the_mutex->Attributes.lock_nesting_behavior ) { case CORE_MUTEX_NESTING_ACQUIRES: _CORE_mutex_Release( the_mutex, queue_context ); - return CORE_MUTEX_STATUS_SUCCESSFUL; + return STATUS_SUCCESSFUL; #if defined(RTEMS_POSIX_API) case CORE_MUTEX_NESTING_IS_ERROR: /* should never occur */ _CORE_mutex_Release( the_mutex, queue_context ); - return CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; + return STATUS_NESTING_NOT_ALLOWED; #endif case CORE_MUTEX_NESTING_BLOCKS: /* Currently no API exercises this behavior. */ @@ -83,7 +83,7 @@ CORE_mutex_Status _CORE_mutex_Surrender( #else _CORE_mutex_Release( the_mutex, queue_context ); /* must be CORE_MUTEX_NESTING_ACQUIRES or we wouldn't be here */ - return CORE_MUTEX_STATUS_SUCCESSFUL; + return STATUS_SUCCESSFUL; #endif } @@ -179,5 +179,5 @@ CORE_mutex_Status _CORE_mutex_Surrender( } } - return CORE_MUTEX_STATUS_SUCCESSFUL; + return STATUS_SUCCESSFUL; } -- cgit v1.2.3