summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/corebarrierwait.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/corebarrierwait.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 'cpukit/score/src/corebarrierwait.c')
-rw-r--r--cpukit/score/src/corebarrierwait.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/cpukit/score/src/corebarrierwait.c b/cpukit/score/src/corebarrierwait.c
index 33f1718a66..a1c862d293 100644
--- a/cpukit/score/src/corebarrierwait.c
+++ b/cpukit/score/src/corebarrierwait.c
@@ -20,8 +20,9 @@
#include <rtems/score/corebarrierimpl.h>
#include <rtems/score/statesimpl.h>
+#include <rtems/score/threadimpl.h>
-void _CORE_barrier_Seize(
+Status_Control _CORE_barrier_Seize(
CORE_barrier_Control *the_barrier,
Thread_Control *executing,
bool wait,
@@ -31,8 +32,6 @@ void _CORE_barrier_Seize(
{
uint32_t number_of_waiting_threads;
- executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL;
-
_CORE_barrier_Acquire_critical( the_barrier, queue_context );
number_of_waiting_threads = the_barrier->number_of_waiting_threads;
@@ -42,8 +41,8 @@ void _CORE_barrier_Seize(
_CORE_barrier_Is_automatic( &the_barrier->Attributes )
&& number_of_waiting_threads == the_barrier->Attributes.maximum_count
) {
- executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED;
_CORE_barrier_Surrender( the_barrier, queue_context );
+ return STATUS_BARRIER_AUTOMATICALLY_RELEASED;
} else {
the_barrier->number_of_waiting_threads = number_of_waiting_threads;
_Thread_queue_Enqueue_critical(
@@ -52,8 +51,8 @@ void _CORE_barrier_Seize(
executing,
STATES_WAITING_FOR_BARRIER,
timeout,
- CORE_BARRIER_TIMEOUT,
&queue_context->Lock_context
);
+ return _Thread_Wait_get_status( executing );
}
}