summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/threadimpl.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/threadimpl.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/threadimpl.h')
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index cef2786ae4..10811088c9 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -29,6 +29,7 @@
#include <rtems/score/objectimpl.h>
#include <rtems/score/resourceimpl.h>
#include <rtems/score/statesimpl.h>
+#include <rtems/score/status.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/threadqimpl.h>
#include <rtems/score/todimpl.h>
@@ -1450,20 +1451,6 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_restore_default_operations(
}
/**
- * @brief Sets the thread wait timeout code.
- *
- * @param[in] the_thread The thread.
- * @param[in] timeout_code The new thread wait timeout code.
- */
-RTEMS_INLINE_ROUTINE void _Thread_Wait_set_timeout_code(
- Thread_Control *the_thread,
- uint32_t timeout_code
-)
-{
- the_thread->Wait.timeout_code = timeout_code;
-}
-
-/**
* @brief Returns the object identifier of the object containing the current
* thread wait queue.
*
@@ -1479,6 +1466,13 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_set_timeout_code(
*/
Objects_Id _Thread_Wait_get_id( const Thread_Control *the_thread );
+RTEMS_INLINE_ROUTINE Status_Control _Thread_Wait_get_status(
+ const Thread_Control *the_thread
+)
+{
+ return (Status_Control) the_thread->Wait.return_code;
+}
+
/**
* @brief General purpose thread wait timeout.
*