summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-08-17 17:56:35 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-08-17 17:56:35 +0200
commitd4f438986dd19b850a1f612823951ce521a12d5d (patch)
treed37237e1b631be35f7262aa39bb0bf0fdd045bea
parent0f441735884810f232bfe8731d490803b95584f0 (diff)
tx-support
-rw-r--r--testsuites/validation/tx-thread-queue.c46
-rw-r--r--testsuites/validation/tx-thread-queue.h21
2 files changed, 37 insertions, 30 deletions
diff --git a/testsuites/validation/tx-thread-queue.c b/testsuites/validation/tx-thread-queue.c
index 870814b126..554137833d 100644
--- a/testsuites/validation/tx-thread-queue.c
+++ b/testsuites/validation/tx-thread-queue.c
@@ -446,6 +446,19 @@ void TQSurrender( TQContext *ctx )
( *ctx->surrender )( ctx );
}
+rtems_tcb *TQGetOwner( TQContext *ctx )
+{
+ rtems_tcb *( *get_owner )( TQContext * );
+
+ get_owner = ctx->get_owner;
+
+ if ( get_owner == NULL ) {
+ return NULL;
+ }
+
+ return ( *get_owner )( ctx );
+}
+
void TQSchedulerRecordStart( TQContext *ctx )
{
T_scheduler_log *log;
@@ -529,6 +542,20 @@ void TQSurrenderClassicSem( TQContext *ctx )
T_rsc_success( sc );
}
+rtems_tcb *TQGetOwnerClassicSem( TQContext *ctx )
+{
+ Semaphore_Control *semaphore;
+ Thread_queue_Context queue_context;
+ rtems_tcb *thread;
+
+ semaphore = _Semaphore_Get( ctx->thread_queue_id, &queue_context );
+ T_assert_not_null( semaphore );
+ thread = semaphore->Core_control.Wait_queue.Queue.owner;
+ _ISR_lock_ISR_enable( &queue_context.Lock_context.Lock_context );
+
+ return thread;
+}
+
uint32_t TQSemGetCount( TQSemContext *ctx )
{
return ( *ctx->get_count )( ctx );
@@ -563,22 +590,3 @@ void TQSemSetCountClassic( TQSemContext *ctx, uint32_t count )
semaphore->Core_control.Semaphore.count = count;
_ISR_lock_ISR_enable( &queue_context.Lock_context.Lock_context );
}
-
-rtems_tcb *TQMtxGetOwner( TQMtxContext *ctx )
-{
- return ( *ctx->get_owner )( ctx );
-}
-
-rtems_tcb *TQMtxGetOwnerClassic( TQMtxContext *ctx )
-{
- Semaphore_Control *semaphore;
- Thread_queue_Context queue_context;
- rtems_tcb *thread;
-
- semaphore = _Semaphore_Get( ctx->base.thread_queue_id, &queue_context );
- T_assert_not_null( semaphore );
- thread = semaphore->Core_control.Wait_queue.Queue.owner;
- _ISR_lock_ISR_enable( &queue_context.Lock_context.Lock_context );
-
- return thread;
-}
diff --git a/testsuites/validation/tx-thread-queue.h b/testsuites/validation/tx-thread-queue.h
index 73ad49e6e2..4d1ce50786 100644
--- a/testsuites/validation/tx-thread-queue.h
+++ b/testsuites/validation/tx-thread-queue.h
@@ -111,8 +111,7 @@ typedef struct TQContext {
/**
* @brief This member defines the enqueue wait behaviour.
*
- * If TQ_NO_WAIT is used, then there no thread queue enqueue shall be
- * performed.
+ * If TQ_NO_WAIT is used, then no thread queue enqueue shall be performed.
*/
TQWait wait;
@@ -236,6 +235,11 @@ typedef struct TQContext {
* @brief This member provides the thread queue surrender handler.
*/
void ( *surrender )( struct TQContext * );
+
+ /**
+ * @brief This member provides the get owner handler.
+ */
+ rtems_tcb *( *get_owner )( struct TQContext * );
} TQContext;
void TQSend(
@@ -307,6 +311,8 @@ void TQEnqueueDone( TQContext *ctx );
void TQSurrender( TQContext *ctx );
+rtems_tcb *TQGetOwner( TQContext *ctx );
+
void TQSchedulerRecordStart( TQContext *ctx );
void TQSchedulerRecordStop( TQContext *ctx );
@@ -323,6 +329,8 @@ Status_Control TQEnqueueClassicSem( TQContext *ctx, TQWait wait );
void TQSurrenderClassicSem( TQContext *ctx );
+rtems_tcb *TQGetOwnerClassicSem( TQContext *ctx );
+
typedef struct TQSemContext {
/**
* @brief This member contains the base thread queue test context.
@@ -372,17 +380,8 @@ typedef struct TQMtxContext {
* ceiling.
*/
rtems_task_priority priority_ceiling;
-
- /**
- * @brief This member provides the mutex get owner handler.
- */
- rtems_tcb *( *get_owner )( struct TQMtxContext * );
} TQMtxContext;
-rtems_tcb *TQMtxGetOwner( TQMtxContext *ctx );
-
-rtems_tcb *TQMtxGetOwnerClassic( TQMtxContext *ctx );
-
/** @} */
#ifdef __cplusplus