summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/corebarrierimpl.h
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/include/rtems/score/corebarrierimpl.h
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/include/rtems/score/corebarrierimpl.h')
-rw-r--r--cpukit/score/include/rtems/score/corebarrierimpl.h42
1 files changed, 4 insertions, 38 deletions
diff --git a/cpukit/score/include/rtems/score/corebarrierimpl.h b/cpukit/score/include/rtems/score/corebarrierimpl.h
index 051990e818..d2d9997d95 100644
--- a/cpukit/score/include/rtems/score/corebarrierimpl.h
+++ b/cpukit/score/include/rtems/score/corebarrierimpl.h
@@ -20,6 +20,7 @@
#define _RTEMS_SCORE_COREBARRIERIMPL_H
#include <rtems/score/corebarrier.h>
+#include <rtems/score/status.h>
#include <rtems/score/threadqimpl.h>
#ifdef __cplusplus
@@ -31,35 +32,6 @@ extern "C" {
*/
/**@{**/
-/**
- * Core Barrier handler return statuses.
- */
-typedef enum {
- /** This status indicates that the operation completed successfully. */
- CORE_BARRIER_STATUS_SUCCESSFUL,
- /** This status indicates that the barrier is configured for automatic
- * release and the caller tripped the automatic release. The caller
- * thus did not block.
- */
- CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED,
- /** This status indicates that the thread was blocked waiting for an
- * operation to complete and the barrier was deleted.
- */
- CORE_BARRIER_WAS_DELETED,
- /** This status indicates that the calling task was willing to block
- * but the operation was unable to complete within the time allotted
- * because the resource never became available.
- */
- CORE_BARRIER_TIMEOUT
-} CORE_barrier_Status;
-
-/**
- * @brief Core barrier last status value.
- *
- * This is the last status value.
- */
-#define CORE_BARRIER_STATUS_LAST CORE_BARRIER_TIMEOUT
-
#define CORE_BARRIER_TQ_OPERATIONS &_Thread_queue_Operations_FIFO
/**
@@ -120,9 +92,9 @@ RTEMS_INLINE_ROUTINE void _CORE_barrier_Release(
* @param[in] mp_callout is the routine to invoke if the
* thread unblocked is remote
*
- * @note Status is returned via the thread control block.
+ * @return The method status.
*/
-void _CORE_barrier_Seize(
+Status_Control _CORE_barrier_Seize(
CORE_barrier_Control *the_barrier,
Thread_Control *executing,
bool wait,
@@ -160,12 +132,6 @@ RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Surrender(
);
}
-Thread_Control *_CORE_barrier_Was_deleted(
- Thread_Control *the_thread,
- Thread_queue_Queue *queue,
- Thread_queue_Context *queue_context
-);
-
RTEMS_INLINE_ROUTINE void _CORE_barrier_Flush(
CORE_barrier_Control *the_barrier,
Thread_queue_Context *queue_context
@@ -173,7 +139,7 @@ RTEMS_INLINE_ROUTINE void _CORE_barrier_Flush(
{
_CORE_barrier_Do_flush(
the_barrier,
- _CORE_barrier_Was_deleted,
+ _Thread_queue_Flush_status_object_was_deleted,
queue_context
);
}