diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-23 13:37:59 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-26 21:44:31 +0200 |
commit | dce487912d98835b8168e755b60514f5a8592b27 (patch) | |
tree | 8778547fbb0f2dbb07bb6a83f28d3f4464924141 /cpukit/rtems/include | |
parent | posix: Fix sem_init() with too large initial value (diff) | |
download | rtems-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/rtems/include/rtems/rtems/barrierimpl.h | 14 | ||||
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/eventimpl.h | 2 | ||||
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/messageimpl.h | 14 | ||||
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/semimpl.h | 76 | ||||
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/statusimpl.h | 15 |
5 files changed, 16 insertions, 105 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/barrierimpl.h b/cpukit/rtems/include/rtems/rtems/barrierimpl.h index 0eaadfc046..6a98917012 100644 --- a/cpukit/rtems/include/rtems/rtems/barrierimpl.h +++ b/cpukit/rtems/include/rtems/rtems/barrierimpl.h @@ -79,20 +79,6 @@ RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get( _Objects_Get( id, &queue_context->Lock_context, &_Barrier_Information ); } -/** - * @brief Translate SuperCore Barrier Status Code to RTEMS Status Code - * - * This function returns a RTEMS status code based on the barrier - * status code specified. - * - * @param[in] the_status is the SuperCore Barrier status to translate. - * - * @retval a status code indicating success or the reason for failure. - */ -rtems_status_code _Barrier_Translate_core_barrier_return_code ( - CORE_barrier_Status the_status -); - /**@}*/ #ifdef __cplusplus diff --git a/cpukit/rtems/include/rtems/rtems/eventimpl.h b/cpukit/rtems/include/rtems/rtems/eventimpl.h index df488e1f36..933ea0fe2b 100644 --- a/cpukit/rtems/include/rtems/rtems/eventimpl.h +++ b/cpukit/rtems/include/rtems/rtems/eventimpl.h @@ -44,7 +44,7 @@ extern "C" { */ #define EVENT_SETS_NONE_PENDING 0 -void _Event_Seize( +rtems_status_code _Event_Seize( rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, diff --git a/cpukit/rtems/include/rtems/rtems/messageimpl.h b/cpukit/rtems/include/rtems/rtems/messageimpl.h index d6217f171e..c561ff9a4b 100644 --- a/cpukit/rtems/include/rtems/rtems/messageimpl.h +++ b/cpukit/rtems/include/rtems/rtems/messageimpl.h @@ -74,20 +74,6 @@ rtems_status_code _Message_queue_Submit( ); /** - * @brief Message queue Translate Core Message Queue Return Code - * - * This function returns a RTEMS status code based on - * @a the_message_queue_status. - * - * @param[in] the_message_queue_status is the status code to translate - * - * @retval translated RTEMS status code - */ -rtems_status_code _Message_queue_Translate_core_message_queue_return_code ( - uint32_t the_message_queue_status -); - -/** * @brief Deallocates a message queue control block into * the inactive chain of free message queue control blocks. * diff --git a/cpukit/rtems/include/rtems/rtems/semimpl.h b/cpukit/rtems/include/rtems/rtems/semimpl.h index c23bef905a..21e16e99d0 100644 --- a/cpukit/rtems/include/rtems/rtems/semimpl.h +++ b/cpukit/rtems/include/rtems/rtems/semimpl.h @@ -32,82 +32,6 @@ extern "C" { */ extern Objects_Information _Semaphore_Information; -extern const rtems_status_code - _Semaphore_Translate_core_mutex_return_code_[]; - -extern const rtems_status_code - _Semaphore_Translate_core_semaphore_return_code_[]; - -/** - * @brief Semaphore Translate Core Mutex Return Code - * - * This function returns a RTEMS status code based on the mutex - * status code specified. - * - * @param[in] status is the mutex status code to translate - * - * @retval translated RTEMS status code - */ -RTEMS_INLINE_ROUTINE rtems_status_code -_Semaphore_Translate_core_mutex_return_code( - uint32_t status -) -{ - /* - * If this thread is blocking waiting for a result on a remote operation. - */ - #if defined(RTEMS_MULTIPROCESSING) - if ( _Thread_Is_proxy_blocking(status) ) - return RTEMS_PROXY_BLOCKING; - #endif - - /* - * Internal consistency check for bad status from SuperCore - */ - #if defined(RTEMS_DEBUG) - if ( status > CORE_MUTEX_STATUS_LAST ) - return RTEMS_INTERNAL_ERROR; - #endif - return _Semaphore_Translate_core_mutex_return_code_[status]; -} - -#if defined(RTEMS_SMP) -RTEMS_INLINE_ROUTINE rtems_status_code -_Semaphore_Translate_MRSP_status_code( MRSP_Status mrsp_status ) -{ - return (rtems_status_code) mrsp_status; -} -#endif - -/** - * @brief Semaphore Translate Core Semaphore Return Code - * - * This function returns a RTEMS status code based on the semaphore - * status code specified. - * - * @param[in] status is the semaphore status code to translate - * - * @retval translated RTEMS status code - */ -RTEMS_INLINE_ROUTINE rtems_status_code -_Semaphore_Translate_core_semaphore_return_code( - uint32_t status -) -{ - #if defined(RTEMS_MULTIPROCESSING) - if ( _Thread_Is_proxy_blocking(status) ) - return RTEMS_PROXY_BLOCKING; - #endif - /* - * Internal consistency check for bad status from SuperCore - */ - #if defined(RTEMS_DEBUG) - if ( status > CORE_SEMAPHORE_STATUS_LAST ) - return RTEMS_INTERNAL_ERROR; - #endif - return _Semaphore_Translate_core_semaphore_return_code_[status]; -} - /** * @brief Allocates a semaphore control block from * the inactive chain of free semaphore control blocks. diff --git a/cpukit/rtems/include/rtems/rtems/statusimpl.h b/cpukit/rtems/include/rtems/rtems/statusimpl.h index 8aff36a96a..8a51bb8b19 100644 --- a/cpukit/rtems/include/rtems/rtems/statusimpl.h +++ b/cpukit/rtems/include/rtems/rtems/statusimpl.h @@ -18,6 +18,7 @@ #define _RTEMS_RTEMS_STATUSIMPL_H #include <rtems/rtems/status.h> +#include <rtems/score/threadimpl.h> #ifdef __cplusplus extern "C" { @@ -39,6 +40,20 @@ extern "C" { */ extern const rtems_status_code _Status_Object_name_errors_to_status[]; +RTEMS_INLINE_ROUTINE rtems_status_code _Status_Get( + Status_Control status +) +{ + return (rtems_status_code) STATUS_GET_CLASSIC( status ); +} + +RTEMS_INLINE_ROUTINE rtems_status_code _Status_Get_after_wait( + const Thread_Control *executing +) +{ + return _Status_Get( _Thread_Wait_get_status( executing ) ); +} + /**@}*/ #ifdef __cplusplus |