diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-04-08 14:39:17 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-07-12 14:01:24 +0200 |
commit | 0e8f6dfd3c316d34eb6afa99d164654bc307c47e (patch) | |
tree | a9a18895ebf4d2f3a8356e0c4ce4b82e2213f7f3 | |
parent | e53a15b12fa7772f7db6359706f09a5e94a47b05 (diff) |
validation: Add GetThread() to test case support
-rw-r--r-- | testsuites/validation/tx-support.c | 13 | ||||
-rw-r--r-- | testsuites/validation/tx-support.h | 4 |
2 files changed, 16 insertions, 1 deletions
diff --git a/testsuites/validation/tx-support.c b/testsuites/validation/tx-support.c index dcb7603832..0a4a9b6c9a 100644 --- a/testsuites/validation/tx-support.c +++ b/testsuites/validation/tx-support.c @@ -6,7 +6,7 @@ * @ingroup RTEMSTestSuites * * @brief This source file contains the definition of DeleteTask(), - * DoCreateTask(), GetMode(), GetPriority(), GetSelfPriority(), + * DoCreateTask(), GetMode(), GetPriority(), GetSelfPriority(), GetThread(), * ReceiveAnyEvents(), RestoreRunnerASR(), RestoreRunnerMode(), * RestoreRunnerPriority(), SendEvents(), SetMode(), SetSelfPriority(), * SetPriority(), and StartTask(). @@ -44,6 +44,7 @@ #include "tx-support.h" #include <rtems/test.h> +#include <rtems/score/threadimpl.h> rtems_id DoCreateTask( rtems_name name, rtems_task_priority priority ) { @@ -169,3 +170,13 @@ void RestoreRunnerPriority( void ) { SetSelfPriority( PRIO_ULTRA_HIGH ); } + +Thread_Control *GetThread( rtems_id id ) +{ + Thread_Control *the_thread; + ISR_lock_Context lock_context; + + the_thread = _Thread_Get( id, &lock_context ); + _ISR_lock_ISR_enable( &lock_context); + return the_thread; +} diff --git a/testsuites/validation/tx-support.h b/testsuites/validation/tx-support.h index 0fbb9fdfcd..05b9a2347c 100644 --- a/testsuites/validation/tx-support.h +++ b/testsuites/validation/tx-support.h @@ -101,6 +101,10 @@ void RestoreRunnerMode( void ); void RestoreRunnerPriority( void ); +struct _Thread_Control; + +struct _Thread_Control *GetThread( rtems_id id ); + /** * @brief Fails a dynamic memory allocation when the counter reaches zero. * |