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/threadqflush.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'cpukit/score/src/threadqflush.c') diff --git a/cpukit/score/src/threadqflush.c b/cpukit/score/src/threadqflush.c index 8b23194357..df2859d51f 100644 --- a/cpukit/score/src/threadqflush.c +++ b/cpukit/score/src/threadqflush.c @@ -19,6 +19,7 @@ #endif #include +#include Thread_Control *_Thread_queue_Flush_default_filter( Thread_Control *the_thread, @@ -31,6 +32,32 @@ Thread_Control *_Thread_queue_Flush_default_filter( return the_thread; } +Thread_Control *_Thread_queue_Flush_status_object_was_deleted( + Thread_Control *the_thread, + Thread_queue_Queue *queue, + Thread_queue_Context *queue_context +) +{ + the_thread->Wait.return_code = STATUS_OBJECT_WAS_DELETED; + + (void) queue; + (void) queue_context; + return the_thread; +} + +Thread_Control *_Thread_queue_Flush_status_unavailable( + Thread_Control *the_thread, + Thread_queue_Queue *queue, + Thread_queue_Context *queue_context +) +{ + the_thread->Wait.return_code = STATUS_UNAVAILABLE; + + (void) queue; + (void) queue_context; + return the_thread; +} + size_t _Thread_queue_Flush_critical( Thread_queue_Queue *queue, const Thread_queue_Operations *operations, -- cgit v1.2.3