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/src/condition.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'cpukit/score/src/condition.c') 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; -- cgit v1.2.3