summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/coremutexsurrender.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-23 13:37:59 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-26 21:44:31 +0200
commitdce487912d98835b8168e755b60514f5a8592b27 (patch)
tree8778547fbb0f2dbb07bb6a83f28d3f4464924141 /cpukit/score/src/coremutexsurrender.c
parentposix: Fix sem_init() with too large initial value (diff)
downloadrtems-dce487912d98835b8168e755b60514f5a8592b27.tar.bz2
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.
Diffstat (limited to '')
-rw-r--r--cpukit/score/src/coremutexsurrender.c14
1 files changed, 7 insertions, 7 deletions
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 <rtems/score/coremuteximpl.h>
#include <rtems/score/thread.h>
-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;
}