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/include/rtems/score/corebarrierimpl.h | 42 +++------------------- 1 file changed, 4 insertions(+), 38 deletions(-) (limited to 'cpukit/score/include/rtems/score/corebarrierimpl.h') 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 +#include #include #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 ); } -- cgit v1.2.3