diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-10-18 19:04:21 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-10-29 16:54:21 +0200 |
commit | 5938686c1b1b8c42842040a063a8ad8d93c01578 (patch) | |
tree | bf895f36516e510ed7b6c594fe88a18370a1dca6 | |
parent | c2741c4aecf6f925006705cb98978a03f31c77ad (diff) |
tx-support
-rw-r--r-- | testsuites/validation/tx-thread-queue.c | 13 | ||||
-rw-r--r-- | testsuites/validation/tx-thread-queue.h | 4 |
2 files changed, 16 insertions, 1 deletions
diff --git a/testsuites/validation/tx-thread-queue.c b/testsuites/validation/tx-thread-queue.c index 3c7895db81..6f6cdc126e 100644 --- a/testsuites/validation/tx-thread-queue.c +++ b/testsuites/validation/tx-thread-queue.c @@ -42,6 +42,7 @@ #include "tx-support.h" #include "ts-config.h" +#include <rtems/score/threadimpl.h> #include <rtems/rtems/semimpl.h> void TQSend( @@ -393,6 +394,18 @@ static void Worker( rtems_task_argument arg, TQWorkerKind worker ) TQMutexRelease( ctx, TQ_MUTEX_FIFO ); } + if ( ( events & TQ_EVENT_PIN ) != 0 ) { + _Thread_Pin( _Thread_Get_executing() ); + } + + if ( ( events & TQ_EVENT_UNPIN ) != 0 ) { + Per_CPU_Control *cpu_self; + + cpu_self = _Thread_Dispatch_disable(); + _Thread_Unpin( _Thread_Get_executing(), cpu_self ); + _Thread_Dispatch_direct( cpu_self ); + } + if ( ( events & TQ_EVENT_SCHEDULER_RECORD_STOP ) != 0 ) { TQSchedulerRecordStop( ctx ); } diff --git a/testsuites/validation/tx-thread-queue.h b/testsuites/validation/tx-thread-queue.h index 2b9edf18a0..a061bfe42c 100644 --- a/testsuites/validation/tx-thread-queue.h +++ b/testsuites/validation/tx-thread-queue.h @@ -132,7 +132,9 @@ typedef enum { TQ_EVENT_MUTEX_FIFO_RELEASE = RTEMS_EVENT_23, TQ_EVENT_ENQUEUE_TIMED = RTEMS_EVENT_24, TQ_EVENT_MUTEX_D_OBTAIN = RTEMS_EVENT_25, - TQ_EVENT_MUTEX_D_RELEASE = RTEMS_EVENT_26 + TQ_EVENT_MUTEX_D_RELEASE = RTEMS_EVENT_26, + TQ_EVENT_PIN = RTEMS_EVENT_27, + TQ_EVENT_UNPIN = RTEMS_EVENT_28 } TQEvent; typedef enum { |