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-28 19:08:17 +0200 |
commit | 34dbd0123b32aa7600a8c855f5079db14c5d823b (patch) | |
tree | 00a73cdb65421fd7d4bda1f60e6992303c46d2c2 | |
parent | 02295e09f2f9d1e8c95180c172862c2e89ae180f (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 { |