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 /testsuites/sptests/spintrcritical20/init.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 'testsuites/sptests/spintrcritical20/init.c')
-rw-r--r-- | testsuites/sptests/spintrcritical20/init.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/testsuites/sptests/spintrcritical20/init.c b/testsuites/sptests/spintrcritical20/init.c index 9c9b5f0903..1697df426a 100644 --- a/testsuites/sptests/spintrcritical20/init.c +++ b/testsuites/sptests/spintrcritical20/init.c @@ -18,6 +18,7 @@ #include <tmacros.h> #include <intrcritical.h> +#include <rtems/score/threadimpl.h> #include <rtems/score/threadqimpl.h> #include <rtems/rtems/semimpl.h> @@ -44,10 +45,6 @@ static void semaphore_task(rtems_task_argument arg) test_context *ctx = (test_context *) arg; ctx->semaphore_task_tcb = _Thread_Get_executing(); - _Thread_Wait_set_timeout_code( - ctx->semaphore_task_tcb, - CORE_SEMAPHORE_TIMEOUT - ); while (true) { rtems_status_code sc = rtems_semaphore_obtain( @@ -76,8 +73,7 @@ static bool test_body(void *arg) cpu_self = _Thread_Dispatch_disable(); rtems_test_assert( - ctx->semaphore_task_tcb->Wait.return_code - == CORE_SEMAPHORE_STATUS_SUCCESSFUL + _Thread_Wait_get_status( ctx->semaphore_task_tcb ) == STATUS_SUCCESSFUL ); /* @@ -94,11 +90,11 @@ static bool test_body(void *arg) _Thread_Timeout(&ctx->semaphore_task_tcb->Timer.Watchdog); - switch (ctx->semaphore_task_tcb->Wait.return_code) { - case CORE_SEMAPHORE_STATUS_SUCCESSFUL: + switch (_Thread_Wait_get_status(ctx->semaphore_task_tcb)) { + case STATUS_SUCCESSFUL: ctx->status_was_successful = true; break; - case CORE_SEMAPHORE_TIMEOUT: + case STATUS_TIMEOUT: ctx->status_was_timeout = true; break; default: |