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/score/src/condition.c | |
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/score/src/condition.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cpukit/score/src/condition.c b/cpukit/score/src/condition.c index c0320b28d4..39924e8c92 100644 --- a/cpukit/score/src/condition.c +++ b/cpukit/score/src/condition.c @@ -91,14 +91,12 @@ static Per_CPU_Control *_Condition_Do_wait( executing = _Condition_Queue_acquire_critical( condition, lock_context ); cpu_self = _Thread_Dispatch_disable_critical( lock_context ); - executing->Wait.return_code = 0; _Thread_queue_Enqueue_critical( &condition->Queue.Queue, CONDITION_TQ_OPERATIONS, executing, STATES_WAITING_FOR_SYS_LOCK_CONDITION, timeout, - ETIMEDOUT, lock_context ); @@ -152,7 +150,7 @@ int _Condition_Wait_timed( _Mutex_Release( _mutex ); executing = cpu_self->executing; _Thread_Dispatch_enable( cpu_self ); - eno = (int) executing->Wait.return_code; + eno = STATUS_GET_POSIX( _Thread_Wait_get_status( executing ) ); _Mutex_Acquire( _mutex ); return eno; @@ -212,7 +210,7 @@ int _Condition_Wait_recursive_timed( _Mutex_recursive_Release( _mutex ); executing = cpu_self->executing; _Thread_Dispatch_enable( cpu_self ); - eno = (int) executing->Wait.return_code; + eno = STATUS_GET_POSIX( _Thread_Wait_get_status( executing ) ); _Mutex_recursive_Acquire( _mutex ); _mutex->_nest_level = nest_level; |