Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:53

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  * @file
0005  *
0006  * @ingroup ScoreTqReqSurrenderPriorityInherit
0007  */
0008 
0009 /*
0010  * Copyright (C) 2021 embedded brains GmbH & Co. KG
0011  *
0012  * Redistribution and use in source and binary forms, with or without
0013  * modification, are permitted provided that the following conditions
0014  * are met:
0015  * 1. Redistributions of source code must retain the above copyright
0016  *    notice, this list of conditions and the following disclaimer.
0017  * 2. Redistributions in binary form must reproduce the above copyright
0018  *    notice, this list of conditions and the following disclaimer in the
0019  *    documentation and/or other materials provided with the distribution.
0020  *
0021  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0022  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0023  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0024  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0025  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0026  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0027  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0028  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0029  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0030  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0031  * POSSIBILITY OF SUCH DAMAGE.
0032  */
0033 
0034 /*
0035  * This file is part of the RTEMS quality process and was automatically
0036  * generated.  If you find something that needs to be fixed or
0037  * worded better please post a report or patch to an RTEMS mailing list
0038  * or raise a bug report:
0039  *
0040  * https://www.rtems.org/bugs.html
0041  *
0042  * For information on updating and regenerating please refer to the How-To
0043  * section in the Software Requirements Engineering chapter of the
0044  * RTEMS Software Engineering manual.  The manual is provided as a part of
0045  * a release.  For development sources please refer to the online
0046  * documentation at:
0047  *
0048  * https://docs.rtems.org
0049  */
0050 
0051 #ifdef HAVE_CONFIG_H
0052 #include "config.h"
0053 #endif
0054 
0055 #include <rtems/score/smpbarrier.h>
0056 #include <rtems/score/threadimpl.h>
0057 
0058 #include "tr-tq-surrender-priority-inherit.h"
0059 #include "tx-support.h"
0060 
0061 #include <rtems/test.h>
0062 
0063 /**
0064  * @defgroup ScoreTqReqSurrenderPriorityInherit \
0065  *   spec:/score/tq/req/surrender-priority-inherit
0066  *
0067  * @ingroup TestsuitesValidationNoClock0
0068  *
0069  * @{
0070  */
0071 
0072 typedef struct {
0073   uint32_t Skip : 1;
0074   uint32_t Pre_SchedulerCount_NA : 1;
0075   uint32_t Pre_InheritedPriority_NA : 1;
0076   uint32_t Pre_PreviousHelping_NA : 1;
0077   uint32_t Pre_UsedScheduler_NA : 1;
0078   uint32_t Pre_NewPriority_NA : 1;
0079   uint32_t Pre_NewHelping_NA : 1;
0080   uint32_t Pre_Suspended_NA : 1;
0081   uint32_t Pre_WaitState_NA : 1;
0082   uint32_t Post_Dequeue : 1;
0083   uint32_t Post_Unblock : 2;
0084   uint32_t Post_PreviousOwnerPriority : 2;
0085   uint32_t Post_NewPriority : 2;
0086   uint32_t Post_RemoveHelper : 2;
0087   uint32_t Post_AddHelper : 2;
0088   uint32_t Post_Suspended : 2;
0089 } ScoreTqReqSurrenderPriorityInherit_Entry;
0090 
0091 /**
0092  * @brief Test context for spec:/score/tq/req/surrender-priority-inherit test
0093  *   case.
0094  */
0095 typedef struct {
0096   /**
0097    * @brief This member contains the call within ISR request.
0098    */
0099   CallWithinISRRequest request;
0100 
0101   /**
0102    * @brief This member contains the barrier to synchronize the runner and the
0103    *   worker.
0104    */
0105   SMP_barrier_Control barrier;
0106 
0107   /**
0108    * @brief If this member is true, then all priorities of the previous owner
0109    *   inherited from the thread queue thread shall be dispensable.
0110    */
0111   bool inherited_priorities_are_dispensible;
0112 
0113   /**
0114    * @brief If this member is true, then all helping schedulers of the previous
0115    *   owner thread gained through the thread queue shall be dispensable.
0116    */
0117   bool helping_schedules_are_dispensible;
0118 
0119   /**
0120    * @brief If this member is true, then the previous owner thread shall use
0121    *   helping scheduler.
0122    */
0123   bool use_helping_scheduler;
0124 
0125   /**
0126    * @brief If this member is true, then the new owner thread shall gain a
0127    *   vital priority.
0128    */
0129   bool gains_new_priority;
0130 
0131   /**
0132    * @brief If this member is true, then the new owner thread shall gain a
0133    *   vital helping scheduler.
0134    */
0135   bool gains_new_helping_scheduler;
0136 
0137   /**
0138    * @brief If this member is true, then the new owner thread shall be
0139    *   suspended.
0140    */
0141   bool suspended;
0142 
0143   /**
0144    * @brief If this member is true, then the new owner thread shall be in the
0145    *   intend to block wait state.
0146    */
0147   bool intend_to_block;
0148 
0149   /**
0150    * @brief If this member is true, then the action was performed.
0151    */
0152   bool action_performed;
0153 
0154   /**
0155    * @brief This member contains the current priority of the previous owner
0156    *   thread before the thread queue surrender operation.
0157    */
0158   rtems_task_priority priority_before;
0159 
0160   /**
0161    * @brief This member contains the current priority of the previous owner
0162    *   thread after the thread queue surrender operation.
0163    */
0164   rtems_task_priority priority_after;
0165 
0166   /**
0167    * @brief This member contains the identifier of the previous owner thread.
0168    */
0169   rtems_id previous_owner;
0170 
0171   /**
0172    * @brief This member contains a copy of the corresponding
0173    *   ScoreTqReqSurrenderPriorityInherit_Run() parameter.
0174    */
0175   TQContext *tq_ctx;
0176 
0177   struct {
0178     /**
0179      * @brief This member defines the pre-condition states for the next action.
0180      */
0181     size_t pcs[ 8 ];
0182 
0183     /**
0184      * @brief If this member is true, then the test action loop is executed.
0185      */
0186     bool in_action_loop;
0187 
0188     /**
0189      * @brief This member contains the next transition map index.
0190      */
0191     size_t index;
0192 
0193     /**
0194      * @brief This member contains the current transition map entry.
0195      */
0196     ScoreTqReqSurrenderPriorityInherit_Entry entry;
0197 
0198     /**
0199      * @brief If this member is true, then the current transition variant
0200      *   should be skipped.
0201      */
0202     bool skip;
0203   } Map;
0204 } ScoreTqReqSurrenderPriorityInherit_Context;
0205 
0206 static ScoreTqReqSurrenderPriorityInherit_Context
0207   ScoreTqReqSurrenderPriorityInherit_Instance;
0208 
0209 static const char * const ScoreTqReqSurrenderPriorityInherit_PreDesc_SchedulerCount[] = {
0210   "One",
0211   "Two",
0212   "More",
0213   "NA"
0214 };
0215 
0216 static const char * const ScoreTqReqSurrenderPriorityInherit_PreDesc_InheritedPriority[] = {
0217   "Vital",
0218   "Dispensable",
0219   "NA"
0220 };
0221 
0222 static const char * const ScoreTqReqSurrenderPriorityInherit_PreDesc_PreviousHelping[] = {
0223   "Vital",
0224   "Dispensable",
0225   "NA"
0226 };
0227 
0228 static const char * const ScoreTqReqSurrenderPriorityInherit_PreDesc_UsedScheduler[] = {
0229   "Home",
0230   "Helping",
0231   "NA"
0232 };
0233 
0234 static const char * const ScoreTqReqSurrenderPriorityInherit_PreDesc_NewPriority[] = {
0235   "Vital",
0236   "Dispensable",
0237   "NA"
0238 };
0239 
0240 static const char * const ScoreTqReqSurrenderPriorityInherit_PreDesc_NewHelping[] = {
0241   "Vital",
0242   "Dispensable",
0243   "NA"
0244 };
0245 
0246 static const char * const ScoreTqReqSurrenderPriorityInherit_PreDesc_Suspended[] = {
0247   "Yes",
0248   "No",
0249   "NA"
0250 };
0251 
0252 static const char * const ScoreTqReqSurrenderPriorityInherit_PreDesc_WaitState[] = {
0253   "Blocked",
0254   "IntendToBlock",
0255   "NA"
0256 };
0257 
0258 static const char * const * const ScoreTqReqSurrenderPriorityInherit_PreDesc[] = {
0259   ScoreTqReqSurrenderPriorityInherit_PreDesc_SchedulerCount,
0260   ScoreTqReqSurrenderPriorityInherit_PreDesc_InheritedPriority,
0261   ScoreTqReqSurrenderPriorityInherit_PreDesc_PreviousHelping,
0262   ScoreTqReqSurrenderPriorityInherit_PreDesc_UsedScheduler,
0263   ScoreTqReqSurrenderPriorityInherit_PreDesc_NewPriority,
0264   ScoreTqReqSurrenderPriorityInherit_PreDesc_NewHelping,
0265   ScoreTqReqSurrenderPriorityInherit_PreDesc_Suspended,
0266   ScoreTqReqSurrenderPriorityInherit_PreDesc_WaitState,
0267   NULL
0268 };
0269 
0270 typedef ScoreTqReqSurrenderPriorityInherit_Context Context;
0271 
0272 #define NEW_OWNER TQ_BLOCKER_A
0273 
0274 #define PREV_OWNER_HELPER_A TQ_BLOCKER_B
0275 
0276 #define PREV_OWNER_HELPER_B TQ_BLOCKER_C
0277 
0278 #define PREV_OWNER_HELPER_C TQ_BLOCKER_D
0279 
0280 #define NEW_OWNER_NEW_HELPER TQ_BLOCKER_E
0281 
0282 #define NEW_OWNER_NEW_PRIORITY TQ_WORKER_F
0283 
0284 #define NEW_OWNER_OLD_PRIORITY TQ_HELPER_C
0285 
0286 #define PREV_OWNER_MOVER TQ_HELPER_A
0287 
0288 #define PREV_OWNER TQ_HELPER_A
0289 
0290 static const rtems_tcb *GetUnblock( Context *ctx, size_t *index )
0291 {
0292   return TQGetNextUnblock( ctx->tq_ctx, index )->thread;
0293 }
0294 
0295 static const rtems_tcb *GetTCB( Context *ctx, TQWorkerKind worker )
0296 {
0297   return ctx->tq_ctx->worker_tcb[ worker ];
0298 }
0299 
0300 static void Surrender( Context *ctx )
0301 {
0302   Status_Control status;
0303 
0304   if ( ctx->suspended ) {
0305     SuspendTask( ctx->tq_ctx->worker_id[ NEW_OWNER ] );
0306   }
0307 
0308   ctx->priority_before = GetSelfPriority();
0309   TQSchedulerRecordStart( ctx->tq_ctx );
0310   status = TQSurrender( ctx->tq_ctx );
0311   T_eq_int( status, TQConvertStatus( ctx->tq_ctx, STATUS_SUCCESSFUL ) );
0312   TQSchedulerRecordStop( ctx->tq_ctx );
0313   T_eq_ptr( TQGetOwner( ctx->tq_ctx ), ctx->tq_ctx->worker_tcb[ NEW_OWNER ] );
0314   ctx->priority_after = GetSelfPriority();
0315 }
0316 
0317 #if defined(RTEMS_SMP)
0318 static void Delay( void *arg )
0319 {
0320   Context          *ctx;
0321   SMP_barrier_State state;
0322 
0323   ctx = arg;
0324   _SMP_barrier_State_initialize( &state );
0325 
0326   /* B0 */
0327   _SMP_barrier_Wait( &ctx->barrier, &state, 2 );
0328 
0329   /* B1 */
0330   _SMP_barrier_Wait( &ctx->barrier, &state, 2 );
0331 }
0332 
0333 static void SchedulerBlock(
0334   void                    *arg,
0335   const T_scheduler_event *event,
0336   T_scheduler_when         when
0337 )
0338 {
0339   Context *ctx;
0340 
0341   ctx = arg;
0342 
0343   if (
0344     when == T_SCHEDULER_BEFORE &&
0345     event->operation == T_SCHEDULER_BLOCK
0346   ) {
0347     T_scheduler_set_event_handler( NULL, NULL );
0348     ctx->request.handler = Delay;
0349     CallWithinISRSubmit( &ctx->request );
0350   }
0351 }
0352 #endif
0353 
0354 static void Setup( Context *ctx )
0355 {
0356 #if defined(RTEMS_SMP)
0357   TQSetScheduler( ctx->tq_ctx, NEW_OWNER, SCHEDULER_B_ID, PRIO_NORMAL );
0358   TQSetPriority( ctx->tq_ctx, PREV_OWNER_HELPER_A, PRIO_VERY_HIGH );
0359   TQSetScheduler(
0360     ctx->tq_ctx,
0361     PREV_OWNER_HELPER_B,
0362     SCHEDULER_B_ID,
0363     PRIO_HIGH
0364   );
0365   TQSetPriority( ctx->tq_ctx, NEW_OWNER_OLD_PRIORITY, PRIO_VERY_LOW );
0366   TQSetPriority( ctx->tq_ctx, NEW_OWNER_NEW_PRIORITY, PRIO_LOW );
0367 
0368   TQSetPriority( ctx->tq_ctx, PREV_OWNER_MOVER, PRIO_ULTRA_HIGH );
0369 
0370   if ( rtems_scheduler_get_processor_maximum() >= 3 ) {
0371     TQSetScheduler(
0372       ctx->tq_ctx,
0373       PREV_OWNER_HELPER_C,
0374       SCHEDULER_C_ID,
0375       PRIO_HIGH
0376     );
0377   }
0378 #else
0379   TQSetPriority( ctx->tq_ctx, NEW_OWNER, PRIO_HIGH );
0380   TQSetPriority( ctx->tq_ctx, PREV_OWNER_HELPER_A, PRIO_HIGH );
0381 #endif
0382 
0383   TQSetPriority( ctx->tq_ctx, TQ_HELPER_B, PRIO_ULTRA_LOW );
0384 }
0385 
0386 static void Action( Context *ctx )
0387 {
0388   Status_Control    status;
0389 #if defined(RTEMS_SMP)
0390   SMP_barrier_State state;
0391 #endif
0392 
0393   ctx->action_performed = true;
0394   ctx->previous_owner = ctx->tq_ctx->runner_id;
0395   TQMutexObtain( ctx->tq_ctx, TQ_MUTEX_A );
0396 #if defined(RTEMS_SMP)
0397   TQSendAndWaitForExecutionStop(
0398     ctx->tq_ctx,
0399     NEW_OWNER,
0400     TQ_EVENT_MUTEX_B_OBTAIN
0401   );
0402 #endif
0403 
0404   if ( ctx->inherited_priorities_are_dispensible ) {
0405     TQSend(
0406       ctx->tq_ctx,
0407       PREV_OWNER_HELPER_A,
0408       TQ_EVENT_MUTEX_A_OBTAIN | TQ_EVENT_MUTEX_A_RELEASE
0409     );
0410   }
0411 
0412 #if defined(RTEMS_SMP)
0413   if ( ctx->helping_schedules_are_dispensible ) {
0414     TQSendAndWaitForExecutionStop(
0415       ctx->tq_ctx,
0416       PREV_OWNER_HELPER_B,
0417       TQ_EVENT_MUTEX_A_OBTAIN | TQ_EVENT_MUTEX_A_RELEASE
0418     );
0419 
0420     if ( ctx->gains_new_priority && ctx->gains_new_helping_scheduler ) {
0421       TQSendAndWaitForExecutionStop(
0422         ctx->tq_ctx,
0423         PREV_OWNER_HELPER_C,
0424         TQ_EVENT_MUTEX_A_OBTAIN | TQ_EVENT_MUTEX_A_RELEASE
0425       );
0426     }
0427   }
0428 #endif
0429 
0430   status = TQEnqueue( ctx->tq_ctx, TQ_NO_WAIT );
0431   T_eq_int( status, TQConvertStatus( ctx->tq_ctx, STATUS_SUCCESSFUL ) );
0432 
0433 #if defined(RTEMS_SMP)
0434   if ( ctx->intend_to_block ) {
0435     _SMP_barrier_Control_initialize( &ctx->barrier );
0436     _SMP_barrier_State_initialize( &state );
0437 
0438     T_scheduler_set_event_handler( SchedulerBlock, ctx );
0439     TQSend( ctx->tq_ctx, NEW_OWNER, TQ_EVENT_ENQUEUE );
0440 
0441     /* B0 */
0442     _SMP_barrier_Wait( &ctx->barrier, &state, 2 );
0443   } else {
0444     TQSendAndWaitForExecutionStop(
0445       ctx->tq_ctx,
0446       NEW_OWNER,
0447       TQ_EVENT_ENQUEUE
0448     );
0449   }
0450 
0451   if ( ctx->gains_new_priority ) {
0452     TQSend(
0453       ctx->tq_ctx,
0454       NEW_OWNER_OLD_PRIORITY,
0455       TQ_EVENT_HELPER_B_SYNC | TQ_EVENT_MUTEX_B_OBTAIN
0456     );
0457     TQSynchronizeRunner();
0458     TQSend(
0459       ctx->tq_ctx,
0460       NEW_OWNER_NEW_PRIORITY,
0461       TQ_EVENT_HELPER_B_SYNC | TQ_EVENT_ENQUEUE
0462     );
0463     TQSynchronizeRunner();
0464 
0465     if ( ctx->gains_new_helping_scheduler ) {
0466       TQSetScheduler(
0467         ctx->tq_ctx,
0468         NEW_OWNER_NEW_HELPER,
0469         SCHEDULER_C_ID,
0470         PRIO_LOW
0471       );
0472       TQSendAndWaitForExecutionStop(
0473         ctx->tq_ctx,
0474         NEW_OWNER_NEW_HELPER,
0475         TQ_EVENT_ENQUEUE
0476       );
0477     }
0478   } else if ( ctx->gains_new_helping_scheduler ) {
0479     TQSetScheduler(
0480       ctx->tq_ctx,
0481       NEW_OWNER_NEW_HELPER,
0482       SCHEDULER_A_ID,
0483       PRIO_LOW
0484     );
0485     TQSend(
0486       ctx->tq_ctx,
0487       NEW_OWNER_NEW_HELPER,
0488       TQ_EVENT_HELPER_B_SYNC | TQ_EVENT_ENQUEUE
0489     );
0490     TQSynchronizeRunner();
0491   }
0492 
0493   /*
0494    * In order to run the validation test variant also for the intend to block
0495    * wait state, we would need at least three processors.  Skip it for now.
0496    */
0497   if ( ctx->use_helping_scheduler && !ctx->intend_to_block ) {
0498     ctx->tq_ctx->busy_wait[ PREV_OWNER_MOVER ] = true;
0499     TQSend( ctx->tq_ctx, PREV_OWNER_MOVER, TQ_EVENT_BUSY_WAIT );
0500 
0501     while ( rtems_scheduler_get_processor() != 1 ) {
0502       /* Wait */
0503     }
0504 
0505     ctx->tq_ctx->busy_wait[ PREV_OWNER_MOVER ] = false;
0506   }
0507 #else
0508   TQSend(
0509     ctx->tq_ctx,
0510     NEW_OWNER,
0511     TQ_EVENT_HELPER_B_SYNC | TQ_EVENT_ENQUEUE
0512   );
0513   TQSynchronizeRunner();
0514 #endif
0515 
0516   Surrender( ctx );
0517 
0518 #if defined(RTEMS_SMP)
0519   if ( ctx->intend_to_block ) {
0520     /* B1 */
0521     _SMP_barrier_Wait( &ctx->barrier, &state, 2 );
0522   }
0523 #endif
0524 }
0525 
0526 static void Cleanup( Context *ctx )
0527 {
0528   if ( ctx->suspended ) {
0529     ResumeTask( ctx->tq_ctx->worker_id[ NEW_OWNER ] );
0530   }
0531 
0532   TQSendAndSynchronizeRunner(
0533     ctx->tq_ctx,
0534     NEW_OWNER,
0535     TQ_EVENT_SURRENDER
0536   );
0537   TQWaitForExecutionStop( ctx->tq_ctx, NEW_OWNER );
0538 
0539 #if defined(RTEMS_SMP)
0540   TQSendAndSynchronizeRunner(
0541     ctx->tq_ctx,
0542     NEW_OWNER,
0543     TQ_EVENT_MUTEX_B_RELEASE
0544   );
0545   TQWaitForExecutionStop(
0546     ctx->tq_ctx,
0547     NEW_OWNER
0548   );
0549 
0550   if ( ctx->gains_new_priority ) {
0551     TQSendAndSynchronizeRunner(
0552       ctx->tq_ctx,
0553       NEW_OWNER_OLD_PRIORITY,
0554       TQ_EVENT_MUTEX_B_RELEASE
0555     );
0556     TQSendAndSynchronizeRunner(
0557       ctx->tq_ctx,
0558       NEW_OWNER_NEW_PRIORITY,
0559       TQ_EVENT_SURRENDER
0560     );
0561   }
0562 
0563   if ( ctx->gains_new_helping_scheduler ) {
0564     TQSendAndSynchronizeRunner(
0565       ctx->tq_ctx,
0566       NEW_OWNER_NEW_HELPER,
0567       TQ_EVENT_SURRENDER
0568     );
0569   }
0570 #endif
0571 
0572   TQMutexRelease( ctx->tq_ctx, TQ_MUTEX_A );
0573   TQMutexObtain( ctx->tq_ctx, TQ_MUTEX_A );
0574   TQMutexRelease( ctx->tq_ctx, TQ_MUTEX_A );
0575 
0576   T_eq_u32( rtems_scheduler_get_processor(), 0 );
0577 }
0578 
0579 static void SetupSticky( Context *ctx )
0580 {
0581 #if defined(RTEMS_SMP)
0582   TQSetScheduler( ctx->tq_ctx, NEW_OWNER, SCHEDULER_B_ID, PRIO_NORMAL );
0583   TQSetPriority( ctx->tq_ctx, PREV_OWNER_HELPER_A, PRIO_VERY_HIGH );
0584   TQSetScheduler( ctx->tq_ctx,
0585     PREV_OWNER_HELPER_B,
0586     SCHEDULER_B_ID,
0587     PRIO_LOW
0588   );
0589   TQSetPriority( ctx->tq_ctx, NEW_OWNER_NEW_HELPER, PRIO_VERY_HIGH );
0590   TQSetPriority( ctx->tq_ctx, PREV_OWNER, PRIO_NORMAL );
0591 #endif
0592 }
0593 
0594 static void ActionSticky( Context *ctx )
0595 {
0596 #if defined(RTEMS_SMP)
0597   ctx->action_performed = true;
0598   ctx->previous_owner = ctx->tq_ctx->worker_id[ PREV_OWNER ];
0599 
0600   SetSelfPriority( PRIO_LOW );
0601 
0602   if (
0603     ctx->inherited_priorities_are_dispensible ||
0604     ctx->helping_schedules_are_dispensible
0605   ) {
0606     TQSend( ctx->tq_ctx, PREV_OWNER, TQ_EVENT_MUTEX_A_OBTAIN );
0607 
0608     if ( ctx->inherited_priorities_are_dispensible ) {
0609       TQSend( ctx->tq_ctx, PREV_OWNER_HELPER_A, TQ_EVENT_MUTEX_A_OBTAIN );
0610     }
0611 
0612     if ( ctx->helping_schedules_are_dispensible ) {
0613       TQSendAndWaitForExecutionStop(
0614         ctx->tq_ctx,
0615         PREV_OWNER_HELPER_B,
0616         TQ_EVENT_MUTEX_A_OBTAIN
0617       );
0618     }
0619   }
0620 
0621   /*
0622    * Take only the priorities into account which are inherited from the
0623    * priority inheritance mutex.  This avoids having to deal with the ceiling
0624    * priority.
0625    */
0626   ctx->priority_before = TQGetPriority( ctx->tq_ctx, PREV_OWNER );
0627 
0628   SetSelfScheduler( SCHEDULER_B_ID, PRIO_ULTRA_HIGH );
0629   ctx->tq_ctx->busy_wait[ PREV_OWNER ] = true;
0630   TQSendAndSynchronizeRunner(
0631     ctx->tq_ctx,
0632     PREV_OWNER,
0633     TQ_EVENT_ENQUEUE | TQ_EVENT_BUSY_WAIT
0634   );
0635   SetSelfScheduler( SCHEDULER_A_ID, PRIO_ULTRA_HIGH );
0636 
0637   TQSendAndWaitForIntendToBlock(
0638     ctx->tq_ctx,
0639     NEW_OWNER,
0640     TQ_EVENT_ENQUEUE
0641   );
0642 
0643   SetSelfScheduler( SCHEDULER_B_ID, PRIO_ULTRA_HIGH );
0644 
0645   if ( ctx->gains_new_helping_scheduler ) {
0646     TQSend(
0647       ctx->tq_ctx,
0648       NEW_OWNER_NEW_HELPER,
0649       TQ_EVENT_ENQUEUE
0650     );
0651     YieldTask( ctx->tq_ctx->worker_id[ PREV_OWNER ] );
0652     TQWaitForEventsReceived( ctx->tq_ctx, NEW_OWNER_NEW_HELPER );
0653     TQWaitForIntendToBlock( ctx->tq_ctx, NEW_OWNER_NEW_HELPER );
0654     YieldTask( ctx->tq_ctx->worker_id[ NEW_OWNER_NEW_HELPER ] );
0655   }
0656 
0657   if ( ctx->use_helping_scheduler ) {
0658     SetSelfScheduler( SCHEDULER_A_ID, PRIO_ULTRA_HIGH );
0659   }
0660 
0661   if ( ctx->suspended ) {
0662     SuspendTask( ctx->tq_ctx->worker_id[ NEW_OWNER ] );
0663   }
0664 
0665   ctx->tq_ctx->busy_wait[ PREV_OWNER ] = false;
0666   TQSendAndWaitForExecutionStop(
0667     ctx->tq_ctx,
0668     PREV_OWNER,
0669     TQ_EVENT_SCHEDULER_RECORD_START |
0670       TQ_EVENT_SURRENDER
0671   );
0672   TQSchedulerRecordStop( ctx->tq_ctx );
0673   T_eq_ptr(
0674     TQGetOwner( ctx->tq_ctx ),
0675     ctx->tq_ctx->worker_tcb[ NEW_OWNER ]
0676   );
0677   ctx->priority_after = TQGetPriority( ctx->tq_ctx, PREV_OWNER );
0678 #endif
0679 }
0680 
0681 static void CleanupSticky( Context *ctx )
0682 {
0683 #if defined(RTEMS_SMP)
0684   SetSelfScheduler( SCHEDULER_A_ID, PRIO_ULTRA_HIGH );
0685 
0686   if ( ctx->suspended ) {
0687     ResumeTask( ctx->tq_ctx->worker_id[ NEW_OWNER ] );
0688   }
0689 
0690   TQSendAndSynchronizeRunner(
0691     ctx->tq_ctx,
0692     NEW_OWNER,
0693     TQ_EVENT_SURRENDER
0694   );
0695 
0696   if ( ctx->gains_new_helping_scheduler ) {
0697     TQSendAndSynchronizeRunner(
0698       ctx->tq_ctx,
0699       NEW_OWNER_NEW_HELPER,
0700       TQ_EVENT_SURRENDER
0701     );
0702   }
0703 
0704   if (
0705     ctx->inherited_priorities_are_dispensible ||
0706     ctx->helping_schedules_are_dispensible
0707   ) {
0708     TQSendAndSynchronizeRunner(
0709       ctx->tq_ctx,
0710       PREV_OWNER,
0711       TQ_EVENT_MUTEX_A_RELEASE
0712     );
0713 
0714     if ( ctx->inherited_priorities_are_dispensible ) {
0715       TQSendAndSynchronizeRunner(
0716         ctx->tq_ctx,
0717         PREV_OWNER_HELPER_A,
0718         TQ_EVENT_MUTEX_A_RELEASE
0719       );
0720     }
0721 
0722     if ( ctx->helping_schedules_are_dispensible ) {
0723       TQSendAndSynchronizeRunner(
0724         ctx->tq_ctx,
0725         PREV_OWNER_HELPER_B,
0726         TQ_EVENT_MUTEX_A_RELEASE
0727       );
0728     }
0729   }
0730 
0731   T_eq_u32( rtems_scheduler_get_processor(), 0 );
0732 #endif
0733 }
0734 
0735 static void ScoreTqReqSurrenderPriorityInherit_Pre_SchedulerCount_Prepare(
0736   ScoreTqReqSurrenderPriorityInherit_Context           *ctx,
0737   ScoreTqReqSurrenderPriorityInherit_Pre_SchedulerCount state
0738 )
0739 {
0740   switch ( state ) {
0741     case ScoreTqReqSurrenderPriorityInherit_Pre_SchedulerCount_One: {
0742       /*
0743        * Where the system has exactly one schedulers.
0744        */
0745       if ( rtems_scheduler_get_processor_maximum() != 1 ) {
0746         ctx->Map.skip = true;
0747       }
0748       break;
0749     }
0750 
0751     case ScoreTqReqSurrenderPriorityInherit_Pre_SchedulerCount_Two: {
0752       /*
0753        * Where the system has exactly two schedulers.
0754        */
0755       if ( rtems_scheduler_get_processor_maximum() != 2 ) {
0756         ctx->Map.skip = true;
0757       }
0758       break;
0759     }
0760 
0761     case ScoreTqReqSurrenderPriorityInherit_Pre_SchedulerCount_More: {
0762       /*
0763        * Where the system has at least three schedulers.
0764        */
0765       if ( rtems_scheduler_get_processor_maximum() < 3 ) {
0766         ctx->Map.skip = true;
0767       }
0768       break;
0769     }
0770 
0771     case ScoreTqReqSurrenderPriorityInherit_Pre_SchedulerCount_NA:
0772       break;
0773   }
0774 }
0775 
0776 static void ScoreTqReqSurrenderPriorityInherit_Pre_InheritedPriority_Prepare(
0777   ScoreTqReqSurrenderPriorityInherit_Context              *ctx,
0778   ScoreTqReqSurrenderPriorityInherit_Pre_InheritedPriority state
0779 )
0780 {
0781   switch ( state ) {
0782     case ScoreTqReqSurrenderPriorityInherit_Pre_InheritedPriority_Vital: {
0783       /*
0784        * While at least one priority inherited through the thread queue for the
0785        * previous owner is the highest priority of the previous owner.
0786        */
0787       ctx->inherited_priorities_are_dispensible = false;
0788       break;
0789     }
0790 
0791     case ScoreTqReqSurrenderPriorityInherit_Pre_InheritedPriority_Dispensable: {
0792       /*
0793        * While all priorities inherited through the thread queue for the
0794        * previous owner are not the highest priority of the previous owner.
0795        */
0796       ctx->inherited_priorities_are_dispensible = true;
0797       break;
0798     }
0799 
0800     case ScoreTqReqSurrenderPriorityInherit_Pre_InheritedPriority_NA:
0801       break;
0802   }
0803 }
0804 
0805 static void ScoreTqReqSurrenderPriorityInherit_Pre_PreviousHelping_Prepare(
0806   ScoreTqReqSurrenderPriorityInherit_Context            *ctx,
0807   ScoreTqReqSurrenderPriorityInherit_Pre_PreviousHelping state
0808 )
0809 {
0810   switch ( state ) {
0811     case ScoreTqReqSurrenderPriorityInherit_Pre_PreviousHelping_Vital: {
0812       /*
0813        * While at least one helping scheduler of the previous owner is only
0814        * available due to a priority inherited through the thread queue.
0815        */
0816       ctx->helping_schedules_are_dispensible = false;
0817       break;
0818     }
0819 
0820     case ScoreTqReqSurrenderPriorityInherit_Pre_PreviousHelping_Dispensable: {
0821       /*
0822        * While all helping scheduler of the previous owner are not only
0823        * available due to a priority inherited through the thread queue.
0824        */
0825       ctx->helping_schedules_are_dispensible = true;
0826       break;
0827     }
0828 
0829     case ScoreTqReqSurrenderPriorityInherit_Pre_PreviousHelping_NA:
0830       break;
0831   }
0832 }
0833 
0834 static void ScoreTqReqSurrenderPriorityInherit_Pre_UsedScheduler_Prepare(
0835   ScoreTqReqSurrenderPriorityInherit_Context          *ctx,
0836   ScoreTqReqSurrenderPriorityInherit_Pre_UsedScheduler state
0837 )
0838 {
0839   switch ( state ) {
0840     case ScoreTqReqSurrenderPriorityInherit_Pre_UsedScheduler_Home: {
0841       /*
0842        * While the previous owner executes in its home scheduler.
0843        */
0844       ctx->use_helping_scheduler = false;
0845       break;
0846     }
0847 
0848     case ScoreTqReqSurrenderPriorityInherit_Pre_UsedScheduler_Helping: {
0849       /*
0850        * While the previous owner executes in a helping scheduler which is
0851        * available due to a priority inherited through the thread queue.
0852        */
0853       ctx->use_helping_scheduler = true;
0854       break;
0855     }
0856 
0857     case ScoreTqReqSurrenderPriorityInherit_Pre_UsedScheduler_NA:
0858       break;
0859   }
0860 }
0861 
0862 static void ScoreTqReqSurrenderPriorityInherit_Pre_NewPriority_Prepare(
0863   ScoreTqReqSurrenderPriorityInherit_Context        *ctx,
0864   ScoreTqReqSurrenderPriorityInherit_Pre_NewPriority state
0865 )
0866 {
0867   switch ( state ) {
0868     case ScoreTqReqSurrenderPriorityInherit_Pre_NewPriority_Vital: {
0869       /*
0870        * While at least one highest priority of the new owner is only available
0871        * due to a priority inherited through the thread queue.
0872        */
0873       ctx->gains_new_priority = true;
0874       break;
0875     }
0876 
0877     case ScoreTqReqSurrenderPriorityInherit_Pre_NewPriority_Dispensable: {
0878       /*
0879        * While all highest priorities of the new owner are not only available
0880        * due to a priority inherited through the thread queue.
0881        */
0882       ctx->gains_new_priority = false;
0883       break;
0884     }
0885 
0886     case ScoreTqReqSurrenderPriorityInherit_Pre_NewPriority_NA:
0887       break;
0888   }
0889 }
0890 
0891 static void ScoreTqReqSurrenderPriorityInherit_Pre_NewHelping_Prepare(
0892   ScoreTqReqSurrenderPriorityInherit_Context       *ctx,
0893   ScoreTqReqSurrenderPriorityInherit_Pre_NewHelping state
0894 )
0895 {
0896   switch ( state ) {
0897     case ScoreTqReqSurrenderPriorityInherit_Pre_NewHelping_Vital: {
0898       /*
0899        * While at least one helping scheduler of the new owner is only
0900        * available due to a priority inherited through the thread queue.
0901        */
0902       ctx->gains_new_helping_scheduler = true;
0903       break;
0904     }
0905 
0906     case ScoreTqReqSurrenderPriorityInherit_Pre_NewHelping_Dispensable: {
0907       /*
0908        * While all helping scheduler of the new owner are not only available
0909        * due to a priority inherited through the thread queue.
0910        */
0911       ctx->gains_new_helping_scheduler = false;
0912       break;
0913     }
0914 
0915     case ScoreTqReqSurrenderPriorityInherit_Pre_NewHelping_NA:
0916       break;
0917   }
0918 }
0919 
0920 static void ScoreTqReqSurrenderPriorityInherit_Pre_Suspended_Prepare(
0921   ScoreTqReqSurrenderPriorityInherit_Context      *ctx,
0922   ScoreTqReqSurrenderPriorityInherit_Pre_Suspended state
0923 )
0924 {
0925   switch ( state ) {
0926     case ScoreTqReqSurrenderPriorityInherit_Pre_Suspended_Yes: {
0927       /*
0928        * While the new owner is suspended.
0929        */
0930       ctx->suspended = true;
0931       break;
0932     }
0933 
0934     case ScoreTqReqSurrenderPriorityInherit_Pre_Suspended_No: {
0935       /*
0936        * While the new owner is not suspended.
0937        */
0938       ctx->suspended = false;
0939       break;
0940     }
0941 
0942     case ScoreTqReqSurrenderPriorityInherit_Pre_Suspended_NA:
0943       break;
0944   }
0945 }
0946 
0947 static void ScoreTqReqSurrenderPriorityInherit_Pre_WaitState_Prepare(
0948   ScoreTqReqSurrenderPriorityInherit_Context      *ctx,
0949   ScoreTqReqSurrenderPriorityInherit_Pre_WaitState state
0950 )
0951 {
0952   switch ( state ) {
0953     case ScoreTqReqSurrenderPriorityInherit_Pre_WaitState_Blocked: {
0954       /*
0955        * While the new owner is in the blocked wait state.
0956        */
0957       ctx->intend_to_block = false;
0958       break;
0959     }
0960 
0961     case ScoreTqReqSurrenderPriorityInherit_Pre_WaitState_IntendToBlock: {
0962       /*
0963        * While the new owner is in the intend to block wait state.
0964        */
0965       ctx->intend_to_block = true;
0966       break;
0967     }
0968 
0969     case ScoreTqReqSurrenderPriorityInherit_Pre_WaitState_NA:
0970       break;
0971   }
0972 }
0973 
0974 static void ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Check(
0975   ScoreTqReqSurrenderPriorityInherit_Context     *ctx,
0976   ScoreTqReqSurrenderPriorityInherit_Post_Dequeue state
0977 )
0978 {
0979   switch ( state ) {
0980     case ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority: {
0981       /*
0982        * The first thread in priority order shall be dequeued from the thread
0983        * queue.
0984        */
0985       /* Validation is done by spec:/score/tq/req/enqueue-priority */
0986       break;
0987     }
0988 
0989     case ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA:
0990       break;
0991   }
0992 }
0993 
0994 static void ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Check(
0995   ScoreTqReqSurrenderPriorityInherit_Context     *ctx,
0996   ScoreTqReqSurrenderPriorityInherit_Post_Unblock state
0997 )
0998 {
0999   size_t i;
1000 
1001   i = 0;
1002 
1003   switch ( state ) {
1004     case ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes: {
1005       /*
1006        * The dequeued thread shall be unblocked by the thread queue surrender
1007        * operation.
1008        */
1009       T_eq_ptr( GetUnblock( ctx, &i ), GetTCB( ctx, NEW_OWNER ) );
1010       T_eq_ptr( GetUnblock( ctx, &i ), NULL );
1011       break;
1012     }
1013 
1014     case ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No: {
1015       /*
1016        * The dequeued thread shall not be unblocked by the thread queue
1017        * surrender operation.
1018        */
1019       T_eq_ptr( GetUnblock( ctx, &i ), NULL );
1020       break;
1021     }
1022 
1023     case ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA:
1024       break;
1025   }
1026 }
1027 
1028 static void
1029 ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Check(
1030   ScoreTqReqSurrenderPriorityInherit_Context                   *ctx,
1031   ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority state
1032 )
1033 {
1034   switch ( state ) {
1035     case ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop: {
1036       /*
1037        * Each eligible priority of the previous owner which had the highest
1038        * priority inherited through the thread queue shall be updated.
1039        */
1040       T_eq_u32( ctx->priority_after, PRIO_NORMAL );
1041       break;
1042     }
1043 
1044     case ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop: {
1045       /*
1046        * No eligible priority of the previous owner shall be updated.
1047        */
1048       T_eq_u32( ctx->priority_after, ctx->priority_before );
1049       break;
1050     }
1051 
1052     case ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA:
1053       break;
1054   }
1055 }
1056 
1057 static void ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Check(
1058   ScoreTqReqSurrenderPriorityInherit_Context         *ctx,
1059   ScoreTqReqSurrenderPriorityInherit_Post_NewPriority state
1060 )
1061 {
1062   rtems_id            scheduler_id;
1063   rtems_task_priority priority;
1064   rtems_status_code   sc;
1065 
1066   switch ( state ) {
1067     case ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise: {
1068       /*
1069        * Each eligible priority of the new owner which inherited the highest
1070        * priority through the thread queue shall be updated.
1071        */
1072       sc = rtems_task_get_priority(
1073         ctx->tq_ctx->worker_id[ NEW_OWNER ],
1074         SCHEDULER_A_ID,
1075         &priority
1076       );
1077       T_rsc_success( sc );
1078       T_eq_u32( priority, PRIO_LOW );
1079       break;
1080     }
1081 
1082     case ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop: {
1083       /*
1084        * No highest priority of the new owner shall be changed.
1085        */
1086       if ( ctx->gains_new_helping_scheduler ) {
1087         scheduler_id = SCHEDULER_C_ID;
1088       } else {
1089         scheduler_id = SCHEDULER_A_ID;
1090       }
1091 
1092       sc = rtems_task_get_priority(
1093         ctx->tq_ctx->worker_id[ NEW_OWNER ],
1094         scheduler_id,
1095         &priority
1096       );
1097       #if defined(RTEMS_SMP)
1098       T_rsc( sc, RTEMS_NOT_DEFINED );
1099       #else
1100       T_rsc_success( sc );
1101       T_eq_u32( priority, PRIO_HIGH );
1102       #endif
1103       break;
1104     }
1105 
1106     case ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA:
1107       break;
1108   }
1109 }
1110 
1111 static void ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Check(
1112   ScoreTqReqSurrenderPriorityInherit_Context          *ctx,
1113   ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper state
1114 )
1115 {
1116   rtems_task_priority priority;
1117   rtems_status_code   sc;
1118 
1119   switch ( state ) {
1120     case ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes: {
1121       /*
1122        * Each helping scheduler of the previous owner which was only available
1123        * due to a priority inherited through the thread queue shall be removed
1124        * from the previous owner.
1125        */
1126       sc = rtems_task_get_priority(
1127         ctx->previous_owner,
1128         SCHEDULER_B_ID,
1129         &priority
1130       );
1131       T_rsc( sc, RTEMS_NOT_DEFINED );
1132       break;
1133     }
1134 
1135     case ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No: {
1136       /*
1137        * No helping scheduler shall be removed from the previous owner.
1138        */
1139       sc = rtems_task_get_priority(
1140         ctx->previous_owner,
1141         SCHEDULER_B_ID,
1142         &priority
1143       );
1144       #if defined(RTEMS_SMP)
1145       T_rsc_success( sc );
1146 
1147       if ( ctx->tq_ctx->enqueue_variant == TQ_ENQUEUE_STICKY ) {
1148         T_eq_u32( priority, PRIO_LOW );
1149       } else {
1150         T_eq_u32( priority, PRIO_HIGH );
1151       }
1152       #else
1153       T_rsc( sc, RTEMS_INVALID_ID );
1154       #endif
1155       break;
1156     }
1157 
1158     case ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA:
1159       break;
1160   }
1161 }
1162 
1163 static void ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Check(
1164   ScoreTqReqSurrenderPriorityInherit_Context       *ctx,
1165   ScoreTqReqSurrenderPriorityInherit_Post_AddHelper state
1166 )
1167 {
1168   rtems_id            scheduler_id;
1169   rtems_task_priority priority;
1170   rtems_status_code   sc;
1171 
1172   switch ( state ) {
1173     case ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes: {
1174       /*
1175        * Each helping scheduler of the new owner which is only available due to
1176        * a priority inherited through the thread queue shall be added to the
1177        * new owner.
1178        */
1179       if ( ctx->gains_new_priority ) {
1180         scheduler_id = SCHEDULER_C_ID;
1181       } else {
1182         scheduler_id = SCHEDULER_A_ID;
1183       }
1184 
1185       sc = rtems_task_get_priority(
1186         ctx->tq_ctx->worker_id[ NEW_OWNER ],
1187         scheduler_id,
1188         &priority
1189       );
1190       T_rsc_success( sc );
1191 
1192       if ( ctx->tq_ctx->enqueue_variant == TQ_ENQUEUE_STICKY ) {
1193         T_eq_u32( priority, PRIO_VERY_HIGH );
1194       } else {
1195         T_eq_u32( priority, PRIO_LOW );
1196       }
1197       break;
1198     }
1199 
1200     case ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No: {
1201       /*
1202        * No helping scheduler shall added to the new owner.
1203        */
1204       if ( ctx->gains_new_priority ) {
1205         scheduler_id = SCHEDULER_C_ID;
1206       } else {
1207         scheduler_id = SCHEDULER_A_ID;
1208       }
1209 
1210       sc = rtems_task_get_priority(
1211         ctx->tq_ctx->worker_id[ NEW_OWNER ],
1212         scheduler_id,
1213         &priority
1214       );
1215       #if defined(RTEMS_SMP)
1216       T_rsc( sc, RTEMS_NOT_DEFINED );
1217       #else
1218       T_rsc_success( sc );
1219       T_eq_u32( priority, PRIO_HIGH );
1220       #endif
1221       break;
1222     }
1223 
1224     case ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA:
1225       break;
1226   }
1227 }
1228 
1229 static void ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Check(
1230   ScoreTqReqSurrenderPriorityInherit_Context       *ctx,
1231   ScoreTqReqSurrenderPriorityInherit_Post_Suspended state
1232 )
1233 {
1234   switch ( state ) {
1235     case ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes: {
1236       /*
1237        * The new owner shall be suspended.
1238        */
1239       T_true( IsTaskSuspended( ctx->tq_ctx->worker_id[ NEW_OWNER ] ) );
1240       break;
1241     }
1242 
1243     case ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No: {
1244       /*
1245        * The new owner shall be not suspended.
1246        */
1247       T_false( IsTaskSuspended( ctx->tq_ctx->worker_id[ NEW_OWNER ] ) );
1248       break;
1249     }
1250 
1251     case ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA:
1252       break;
1253   }
1254 }
1255 
1256 static void ScoreTqReqSurrenderPriorityInherit_Setup(
1257   ScoreTqReqSurrenderPriorityInherit_Context *ctx
1258 )
1259 {
1260   ctx->request.arg = ctx;
1261   TQReset( ctx->tq_ctx );
1262 
1263   if ( ctx->tq_ctx->enqueue_variant == TQ_ENQUEUE_STICKY ) {
1264     SetupSticky( ctx );
1265   } else {
1266     Setup( ctx );
1267   }
1268 }
1269 
1270 static void ScoreTqReqSurrenderPriorityInherit_Setup_Wrap( void *arg )
1271 {
1272   ScoreTqReqSurrenderPriorityInherit_Context *ctx;
1273 
1274   ctx = arg;
1275   ctx->Map.in_action_loop = false;
1276   ScoreTqReqSurrenderPriorityInherit_Setup( ctx );
1277 }
1278 
1279 static void ScoreTqReqSurrenderPriorityInherit_Teardown(
1280   ScoreTqReqSurrenderPriorityInherit_Context *ctx
1281 )
1282 {
1283   SetSelfScheduler( SCHEDULER_A_ID, PRIO_NORMAL );
1284 }
1285 
1286 static void ScoreTqReqSurrenderPriorityInherit_Teardown_Wrap( void *arg )
1287 {
1288   ScoreTqReqSurrenderPriorityInherit_Context *ctx;
1289 
1290   ctx = arg;
1291   ctx->Map.in_action_loop = false;
1292   ScoreTqReqSurrenderPriorityInherit_Teardown( ctx );
1293 }
1294 
1295 static void ScoreTqReqSurrenderPriorityInherit_Prepare(
1296   ScoreTqReqSurrenderPriorityInherit_Context *ctx
1297 )
1298 {
1299   ctx->action_performed = false;
1300   ctx->inherited_priorities_are_dispensible = true;
1301   ctx->helping_schedules_are_dispensible = true;
1302   ctx->use_helping_scheduler = false;
1303   ctx->gains_new_priority = false;
1304   ctx->gains_new_helping_scheduler = false;
1305   ctx->intend_to_block = false;
1306 }
1307 
1308 static void ScoreTqReqSurrenderPriorityInherit_Action(
1309   ScoreTqReqSurrenderPriorityInherit_Context *ctx
1310 )
1311 {
1312   if ( ctx->tq_ctx->enqueue_variant == TQ_ENQUEUE_STICKY ) {
1313     ActionSticky( ctx );
1314   } else {
1315     Action( ctx );
1316   }
1317 }
1318 
1319 static void ScoreTqReqSurrenderPriorityInherit_Cleanup(
1320   ScoreTqReqSurrenderPriorityInherit_Context *ctx
1321 )
1322 {
1323   if ( ctx->action_performed ) {
1324     if ( ctx->tq_ctx->enqueue_variant == TQ_ENQUEUE_STICKY ) {
1325       CleanupSticky( ctx );
1326     } else {
1327       Cleanup( ctx );
1328     }
1329   }
1330 }
1331 
1332 static const ScoreTqReqSurrenderPriorityInherit_Entry
1333 ScoreTqReqSurrenderPriorityInherit_Entries[] = {
1334   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1335     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1336     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1337     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1338     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1339     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1340     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1341     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1342 #if !defined(RTEMS_SMP)
1343   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1344     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1345     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1346     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1347     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1348     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1349     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1350     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1351 #else
1352   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1353     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1354     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1355     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1356     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1357     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1358     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1359     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1360 #endif
1361   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1362     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1363     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1364     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1365     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1366     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1367     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1368     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1369 #if !defined(RTEMS_SMP)
1370   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1371     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1372     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1373     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1374     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1375     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1376     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1377     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1378 #else
1379   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1380     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1381     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1382     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1383     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1384     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1385     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1386     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1387 #endif
1388   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1389     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1390     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1391     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1392     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1393     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1394     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1395     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1396 #if !defined(RTEMS_SMP)
1397   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1398     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1399     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1400     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1401     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1402     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1403     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1404     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1405 #else
1406   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1407     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1408     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1409     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1410     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1411     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1412     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1413     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1414 #endif
1415   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1416     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1417     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
1418     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1419     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1420     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1421     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1422     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1423 #if !defined(RTEMS_SMP)
1424   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1425     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1426     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1427     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1428     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1429     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1430     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1431     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1432 #else
1433   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1434     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1435     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1436     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1437     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1438     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1439     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1440     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1441 #endif
1442   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1443     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1444     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1445     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1446     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1447     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1448     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1449     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1450 #if !defined(RTEMS_SMP)
1451   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1452     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1453     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1454     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1455     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1456     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1457     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1458     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1459 #else
1460   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1461     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1462     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1463     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1464     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1465     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1466     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1467     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1468 #endif
1469   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1470     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1471     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
1472     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1473     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1474     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1475     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1476     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1477 #if !defined(RTEMS_SMP)
1478   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1479     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1480     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1481     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1482     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1483     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1484     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1485     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1486 #else
1487   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1488     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1489     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1490     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1491     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1492     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1493     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1494     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1495 #endif
1496   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1497     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1498     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1499     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1500     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1501     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1502     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1503     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1504 #if !defined(RTEMS_SMP)
1505   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1506     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1507     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1508     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1509     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1510     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1511     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1512     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1513 #else
1514   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1515     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1516     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1517     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1518     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1519     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1520     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1521     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1522 #endif
1523   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1524     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1525     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
1526     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1527     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1528     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1529     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1530     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1531 #if !defined(RTEMS_SMP)
1532   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1533     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1534     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1535     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1536     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1537     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1538     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1539     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1540 #else
1541   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1542     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1543     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1544     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1545     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1546     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1547     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1548     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1549 #endif
1550   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1551     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1552     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1553     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1554     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1555     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1556     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
1557     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1558 #if !defined(RTEMS_SMP)
1559   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1560     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1561     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1562     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1563     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1564     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1565     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1566     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1567 #else
1568   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1569     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1570     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1571     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1572     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1573     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1574     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
1575     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1576 #endif
1577   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1578     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1579     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
1580     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1581     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1582     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1583     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
1584     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1585 #if !defined(RTEMS_SMP)
1586   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1587     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1588     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1589     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1590     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1591     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1592     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1593     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1594 #else
1595   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1596     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1597     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1598     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1599     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1600     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1601     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
1602     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1603 #endif
1604   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1605     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1606     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1607     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1608     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1609     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1610     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1611     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1612 #if !defined(RTEMS_SMP)
1613   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1614     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1615     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1616     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1617     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1618     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1619     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1620     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1621 #else
1622   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1623     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1624     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1625     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1626     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1627     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1628     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1629     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1630 #endif
1631   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1632     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1633     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
1634     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1635     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1636     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1637     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1638     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1639 #if !defined(RTEMS_SMP)
1640   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1641     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1642     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1643     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1644     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1645     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1646     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1647     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1648 #else
1649   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1650     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1651     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1652     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1653     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1654     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1655     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1656     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1657 #endif
1658   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1659     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1660     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1661     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1662     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1663     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1664     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1665     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1666 #if !defined(RTEMS_SMP)
1667   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1668     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1669     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1670     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1671     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1672     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1673     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1674     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1675 #else
1676   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1677     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1678     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1679     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1680     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1681     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1682     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1683     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1684 #endif
1685   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1686     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1687     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
1688     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1689     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1690     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1691     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1692     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1693 #if !defined(RTEMS_SMP)
1694   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1695     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1696     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1697     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1698     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1699     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1700     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1701     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1702 #else
1703   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1704     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1705     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1706     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1707     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1708     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1709     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1710     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1711 #endif
1712   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1713     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1714     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1715     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1716     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1717     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1718     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
1719     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1720 #if !defined(RTEMS_SMP)
1721   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1722     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1723     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1724     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1725     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1726     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1727     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1728     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1729 #else
1730   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1731     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1732     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1733     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1734     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1735     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1736     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
1737     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1738 #endif
1739   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1740     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1741     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
1742     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1743     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1744     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1745     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
1746     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1747 #if !defined(RTEMS_SMP)
1748   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1749     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1750     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1751     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1752     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1753     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1754     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1755     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1756 #else
1757   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1758     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1759     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1760     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
1761     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1762     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1763     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
1764     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1765 #endif
1766   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1767     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1768     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1769     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1770     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1771     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1772     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1773     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1774 #if !defined(RTEMS_SMP)
1775   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1776     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1777     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1778     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1779     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1780     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1781     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1782     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1783 #else
1784   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1785     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1786     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1787     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1788     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1789     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1790     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1791     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1792 #endif
1793   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1794     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1795     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
1796     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1797     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1798     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1799     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1800     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1801 #if !defined(RTEMS_SMP)
1802   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1803     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1804     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1805     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1806     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1807     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1808     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1809     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1810 #else
1811   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1812     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1813     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1814     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1815     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1816     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1817     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1818     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1819 #endif
1820   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1821     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1822     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1823     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1824     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1825     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1826     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
1827     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1828 #if !defined(RTEMS_SMP)
1829   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1830     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1831     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1832     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1833     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1834     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1835     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1836     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1837 #else
1838   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1839     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1840     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1841     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1842     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1843     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1844     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
1845     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1846 #endif
1847   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1848     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1849     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
1850     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1851     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1852     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1853     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
1854     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1855 #if !defined(RTEMS_SMP)
1856   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1857     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1858     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1859     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1860     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1861     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1862     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1863     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1864 #else
1865   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1866     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1867     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1868     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1869     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1870     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1871     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
1872     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1873 #endif
1874   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1875     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1876     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1877     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1878     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1879     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1880     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1881     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1882 #if !defined(RTEMS_SMP)
1883   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1884     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1885     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1886     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1887     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1888     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1889     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1890     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1891 #else
1892   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1893     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1894     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1895     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1896     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1897     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1898     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1899     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1900 #endif
1901   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1902     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1903     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
1904     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1905     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1906     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1907     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1908     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1909 #if !defined(RTEMS_SMP)
1910   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1911     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1912     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1913     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1914     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1915     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1916     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1917     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1918 #else
1919   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1920     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1921     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1922     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1923     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1924     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
1925     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1926     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1927 #endif
1928   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1929     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1930     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1931     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1932     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1933     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1934     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1935     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1936 #if !defined(RTEMS_SMP)
1937   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1938     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1939     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1940     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1941     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1942     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1943     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1944     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1945 #else
1946   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1947     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1948     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1949     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1950     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1951     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1952     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1953     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1954 #endif
1955   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1956     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1957     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
1958     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1959     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1960     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1961     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1962     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1963 #if !defined(RTEMS_SMP)
1964   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1965     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1966     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1967     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1968     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1969     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1970     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1971     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1972 #else
1973   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1974     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1975     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1976     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1977     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
1978     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1979     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_No,
1980     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
1981 #endif
1982   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
1983     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
1984     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
1985     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
1986     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
1987     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
1988     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
1989     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
1990 #if !defined(RTEMS_SMP)
1991   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
1992     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
1993     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
1994     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
1995     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
1996     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
1997     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
1998     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
1999 #else
2000   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2001     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2002     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
2003     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
2004     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
2005     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
2006     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2007     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
2008 #endif
2009   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2010     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2011     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
2012     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
2013     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
2014     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
2015     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2016     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
2017 #if !defined(RTEMS_SMP)
2018   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
2019     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
2020     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
2021     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
2022     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
2023     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
2024     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
2025     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
2026 #else
2027   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2028     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2029     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
2030     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
2031     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Nop,
2032     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
2033     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2034     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
2035 #endif
2036   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2037     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2038     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
2039     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
2040     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2041     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
2042     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2043     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
2044 #if !defined(RTEMS_SMP)
2045   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
2046     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
2047     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
2048     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
2049     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
2050     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
2051     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
2052     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
2053 #else
2054   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2055     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2056     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
2057     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
2058     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2059     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
2060     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2061     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
2062 #endif
2063   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2064     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2065     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
2066     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
2067     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2068     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
2069     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2070     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
2071 #if !defined(RTEMS_SMP)
2072   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
2073     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
2074     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
2075     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
2076     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
2077     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
2078     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
2079     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
2080 #else
2081   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2082     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2083     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
2084     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
2085     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2086     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
2087     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2088     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
2089 #endif
2090   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2091     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2092     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
2093     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
2094     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2095     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
2096     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2097     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
2098 #if !defined(RTEMS_SMP)
2099   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
2100     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
2101     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
2102     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
2103     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
2104     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
2105     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
2106     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
2107 #else
2108   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2109     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2110     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
2111     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
2112     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2113     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
2114     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2115     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
2116 #endif
2117   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2118     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2119     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
2120     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
2121     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2122     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
2123     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2124     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
2125 #if !defined(RTEMS_SMP)
2126   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
2127     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
2128     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
2129     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
2130     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
2131     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
2132     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
2133     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
2134 #else
2135   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2136     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2137     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
2138     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Drop,
2139     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2140     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
2141     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2142     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
2143 #endif
2144   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2145     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2146     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
2147     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
2148     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2149     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
2150     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2151     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
2152 #if !defined(RTEMS_SMP)
2153   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
2154     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
2155     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
2156     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
2157     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
2158     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
2159     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
2160     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
2161 #else
2162   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2163     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2164     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
2165     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
2166     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2167     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
2168     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2169     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
2170 #endif
2171   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2172     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2173     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
2174     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
2175     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2176     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
2177     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2178     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
2179 #if !defined(RTEMS_SMP)
2180   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
2181     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
2182     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
2183     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
2184     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
2185     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
2186     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
2187     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
2188 #else
2189   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2190     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2191     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
2192     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
2193     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2194     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Yes,
2195     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2196     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
2197 #endif
2198   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2199     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2200     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
2201     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
2202     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2203     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
2204     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2205     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
2206 #if !defined(RTEMS_SMP)
2207   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
2208     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
2209     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
2210     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
2211     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
2212     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
2213     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
2214     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA },
2215 #else
2216   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2217     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2218     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
2219     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
2220     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2221     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
2222     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2223     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Yes },
2224 #endif
2225   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2226     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2227     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Yes,
2228     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
2229     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2230     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
2231     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2232     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No },
2233 #if !defined(RTEMS_SMP)
2234   { 1, 0, 0, 0, 0, 0, 0, 0, 0,
2235     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_NA,
2236     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_NA,
2237     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_NA,
2238     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_NA,
2239     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_NA,
2240     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_NA,
2241     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_NA }
2242 #else
2243   { 0, 0, 0, 0, 0, 0, 0, 0, 0,
2244     ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Priority,
2245     ScoreTqReqSurrenderPriorityInherit_Post_Unblock_No,
2246     ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Nop,
2247     ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Raise,
2248     ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_No,
2249     ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Yes,
2250     ScoreTqReqSurrenderPriorityInherit_Post_Suspended_No }
2251 #endif
2252 };
2253 
2254 static const uint8_t
2255 ScoreTqReqSurrenderPriorityInherit_Map[] = {
2256   0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
2257   0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 4, 5, 6, 7, 0, 1, 0, 1,
2258   0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
2259   0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
2260   0, 1, 0, 1, 8, 9, 10, 11, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2,
2261   3, 2, 3, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 2, 3, 2, 3, 12, 13,
2262   14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 2, 3, 2, 3, 24, 25, 26, 27, 28, 29,
2263   30, 31, 4, 5, 6, 7, 2, 3, 2, 3, 24, 25, 26, 27, 28, 29, 30, 31, 4, 5, 6, 7,
2264   2, 3, 2, 3, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 2, 3, 2, 3, 32,
2265   33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 2, 3, 2, 3, 44, 45, 46, 47, 48,
2266   49, 50, 51, 8, 9, 10, 11, 2, 3, 2, 3, 44, 45, 46, 47, 48, 49, 50, 51, 8, 9,
2267   10, 11, 52, 53, 54, 55, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 52,
2268   53, 54, 55, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 56, 57, 58, 59,
2269   24, 25, 26, 27, 28, 29, 30, 31, 4, 5, 6, 7, 56, 57, 58, 59, 24, 25, 26, 27,
2270   28, 29, 30, 31, 4, 5, 6, 7, 60, 61, 62, 63, 32, 33, 34, 35, 36, 37, 38, 39,
2271   40, 41, 42, 43, 60, 61, 62, 63, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
2272   43, 64, 65, 66, 67, 44, 45, 46, 47, 48, 49, 50, 51, 8, 9, 10, 11, 64, 65, 66,
2273   67, 44, 45, 46, 47, 48, 49, 50, 51, 8, 9, 10, 11
2274 };
2275 
2276 static size_t ScoreTqReqSurrenderPriorityInherit_Scope(
2277   void  *arg,
2278   char  *buf,
2279   size_t n
2280 )
2281 {
2282   ScoreTqReqSurrenderPriorityInherit_Context *ctx;
2283 
2284   ctx = arg;
2285 
2286   if ( ctx->Map.in_action_loop ) {
2287     return T_get_scope(
2288       ScoreTqReqSurrenderPriorityInherit_PreDesc,
2289       buf,
2290       n,
2291       ctx->Map.pcs
2292     );
2293   }
2294 
2295   return 0;
2296 }
2297 
2298 static T_fixture ScoreTqReqSurrenderPriorityInherit_Fixture = {
2299   .setup = ScoreTqReqSurrenderPriorityInherit_Setup_Wrap,
2300   .stop = NULL,
2301   .teardown = ScoreTqReqSurrenderPriorityInherit_Teardown_Wrap,
2302   .scope = ScoreTqReqSurrenderPriorityInherit_Scope,
2303   .initial_context = &ScoreTqReqSurrenderPriorityInherit_Instance
2304 };
2305 
2306 static const uint8_t ScoreTqReqSurrenderPriorityInherit_Weights[] = {
2307   128, 64, 32, 16, 8, 4, 2, 1
2308 };
2309 
2310 static void ScoreTqReqSurrenderPriorityInherit_Skip(
2311   ScoreTqReqSurrenderPriorityInherit_Context *ctx,
2312   size_t                                      index
2313 )
2314 {
2315   switch ( index + 1 ) {
2316     case 1:
2317       ctx->Map.pcs[ 1 ] = ScoreTqReqSurrenderPriorityInherit_Pre_InheritedPriority_NA - 1;
2318       /* Fall through */
2319     case 2:
2320       ctx->Map.pcs[ 2 ] = ScoreTqReqSurrenderPriorityInherit_Pre_PreviousHelping_NA - 1;
2321       /* Fall through */
2322     case 3:
2323       ctx->Map.pcs[ 3 ] = ScoreTqReqSurrenderPriorityInherit_Pre_UsedScheduler_NA - 1;
2324       /* Fall through */
2325     case 4:
2326       ctx->Map.pcs[ 4 ] = ScoreTqReqSurrenderPriorityInherit_Pre_NewPriority_NA - 1;
2327       /* Fall through */
2328     case 5:
2329       ctx->Map.pcs[ 5 ] = ScoreTqReqSurrenderPriorityInherit_Pre_NewHelping_NA - 1;
2330       /* Fall through */
2331     case 6:
2332       ctx->Map.pcs[ 6 ] = ScoreTqReqSurrenderPriorityInherit_Pre_Suspended_NA - 1;
2333       /* Fall through */
2334     case 7:
2335       ctx->Map.pcs[ 7 ] = ScoreTqReqSurrenderPriorityInherit_Pre_WaitState_NA - 1;
2336       break;
2337   }
2338 }
2339 
2340 static inline ScoreTqReqSurrenderPriorityInherit_Entry
2341 ScoreTqReqSurrenderPriorityInherit_PopEntry(
2342   ScoreTqReqSurrenderPriorityInherit_Context *ctx
2343 )
2344 {
2345   size_t index;
2346 
2347   if ( ctx->Map.skip ) {
2348     size_t i;
2349 
2350     ctx->Map.skip = false;
2351     index = 0;
2352 
2353     for ( i = 0; i < 8; ++i ) {
2354       index += ScoreTqReqSurrenderPriorityInherit_Weights[ i ] * ctx->Map.pcs[ i ];
2355     }
2356   } else {
2357     index = ctx->Map.index;
2358   }
2359 
2360   ctx->Map.index = index + 1;
2361 
2362   return ScoreTqReqSurrenderPriorityInherit_Entries[
2363     ScoreTqReqSurrenderPriorityInherit_Map[ index ]
2364   ];
2365 }
2366 
2367 static void ScoreTqReqSurrenderPriorityInherit_TestVariant(
2368   ScoreTqReqSurrenderPriorityInherit_Context *ctx
2369 )
2370 {
2371   ScoreTqReqSurrenderPriorityInherit_Pre_SchedulerCount_Prepare(
2372     ctx,
2373     ctx->Map.pcs[ 0 ]
2374   );
2375 
2376   if ( ctx->Map.skip ) {
2377     ScoreTqReqSurrenderPriorityInherit_Skip( ctx, 0 );
2378     return;
2379   }
2380 
2381   ScoreTqReqSurrenderPriorityInherit_Pre_InheritedPriority_Prepare(
2382     ctx,
2383     ctx->Map.pcs[ 1 ]
2384   );
2385   ScoreTqReqSurrenderPriorityInherit_Pre_PreviousHelping_Prepare(
2386     ctx,
2387     ctx->Map.pcs[ 2 ]
2388   );
2389   ScoreTqReqSurrenderPriorityInherit_Pre_UsedScheduler_Prepare(
2390     ctx,
2391     ctx->Map.pcs[ 3 ]
2392   );
2393   ScoreTqReqSurrenderPriorityInherit_Pre_NewPriority_Prepare(
2394     ctx,
2395     ctx->Map.pcs[ 4 ]
2396   );
2397   ScoreTqReqSurrenderPriorityInherit_Pre_NewHelping_Prepare(
2398     ctx,
2399     ctx->Map.pcs[ 5 ]
2400   );
2401   ScoreTqReqSurrenderPriorityInherit_Pre_Suspended_Prepare(
2402     ctx,
2403     ctx->Map.pcs[ 6 ]
2404   );
2405   ScoreTqReqSurrenderPriorityInherit_Pre_WaitState_Prepare(
2406     ctx,
2407     ctx->Map.pcs[ 7 ]
2408   );
2409   ScoreTqReqSurrenderPriorityInherit_Action( ctx );
2410   ScoreTqReqSurrenderPriorityInherit_Post_Dequeue_Check(
2411     ctx,
2412     ctx->Map.entry.Post_Dequeue
2413   );
2414   ScoreTqReqSurrenderPriorityInherit_Post_Unblock_Check(
2415     ctx,
2416     ctx->Map.entry.Post_Unblock
2417   );
2418   ScoreTqReqSurrenderPriorityInherit_Post_PreviousOwnerPriority_Check(
2419     ctx,
2420     ctx->Map.entry.Post_PreviousOwnerPriority
2421   );
2422   ScoreTqReqSurrenderPriorityInherit_Post_NewPriority_Check(
2423     ctx,
2424     ctx->Map.entry.Post_NewPriority
2425   );
2426   ScoreTqReqSurrenderPriorityInherit_Post_RemoveHelper_Check(
2427     ctx,
2428     ctx->Map.entry.Post_RemoveHelper
2429   );
2430   ScoreTqReqSurrenderPriorityInherit_Post_AddHelper_Check(
2431     ctx,
2432     ctx->Map.entry.Post_AddHelper
2433   );
2434   ScoreTqReqSurrenderPriorityInherit_Post_Suspended_Check(
2435     ctx,
2436     ctx->Map.entry.Post_Suspended
2437   );
2438 }
2439 
2440 static T_fixture_node ScoreTqReqSurrenderPriorityInherit_Node;
2441 
2442 static T_remark ScoreTqReqSurrenderPriorityInherit_Remark = {
2443   .next = NULL,
2444   .remark = "ScoreTqReqSurrenderPriorityInherit"
2445 };
2446 
2447 void ScoreTqReqSurrenderPriorityInherit_Run( TQContext *tq_ctx )
2448 {
2449   ScoreTqReqSurrenderPriorityInherit_Context *ctx;
2450 
2451   ctx = &ScoreTqReqSurrenderPriorityInherit_Instance;
2452   ctx->tq_ctx = tq_ctx;
2453 
2454   ctx = T_push_fixture(
2455     &ScoreTqReqSurrenderPriorityInherit_Node,
2456     &ScoreTqReqSurrenderPriorityInherit_Fixture
2457   );
2458   ctx->Map.in_action_loop = true;
2459   ctx->Map.index = 0;
2460   ctx->Map.skip = false;
2461 
2462   for (
2463     ctx->Map.pcs[ 0 ] = ScoreTqReqSurrenderPriorityInherit_Pre_SchedulerCount_One;
2464     ctx->Map.pcs[ 0 ] < ScoreTqReqSurrenderPriorityInherit_Pre_SchedulerCount_NA;
2465     ++ctx->Map.pcs[ 0 ]
2466   ) {
2467     for (
2468       ctx->Map.pcs[ 1 ] = ScoreTqReqSurrenderPriorityInherit_Pre_InheritedPriority_Vital;
2469       ctx->Map.pcs[ 1 ] < ScoreTqReqSurrenderPriorityInherit_Pre_InheritedPriority_NA;
2470       ++ctx->Map.pcs[ 1 ]
2471     ) {
2472       for (
2473         ctx->Map.pcs[ 2 ] = ScoreTqReqSurrenderPriorityInherit_Pre_PreviousHelping_Vital;
2474         ctx->Map.pcs[ 2 ] < ScoreTqReqSurrenderPriorityInherit_Pre_PreviousHelping_NA;
2475         ++ctx->Map.pcs[ 2 ]
2476       ) {
2477         for (
2478           ctx->Map.pcs[ 3 ] = ScoreTqReqSurrenderPriorityInherit_Pre_UsedScheduler_Home;
2479           ctx->Map.pcs[ 3 ] < ScoreTqReqSurrenderPriorityInherit_Pre_UsedScheduler_NA;
2480           ++ctx->Map.pcs[ 3 ]
2481         ) {
2482           for (
2483             ctx->Map.pcs[ 4 ] = ScoreTqReqSurrenderPriorityInherit_Pre_NewPriority_Vital;
2484             ctx->Map.pcs[ 4 ] < ScoreTqReqSurrenderPriorityInherit_Pre_NewPriority_NA;
2485             ++ctx->Map.pcs[ 4 ]
2486           ) {
2487             for (
2488               ctx->Map.pcs[ 5 ] = ScoreTqReqSurrenderPriorityInherit_Pre_NewHelping_Vital;
2489               ctx->Map.pcs[ 5 ] < ScoreTqReqSurrenderPriorityInherit_Pre_NewHelping_NA;
2490               ++ctx->Map.pcs[ 5 ]
2491             ) {
2492               for (
2493                 ctx->Map.pcs[ 6 ] = ScoreTqReqSurrenderPriorityInherit_Pre_Suspended_Yes;
2494                 ctx->Map.pcs[ 6 ] < ScoreTqReqSurrenderPriorityInherit_Pre_Suspended_NA;
2495                 ++ctx->Map.pcs[ 6 ]
2496               ) {
2497                 for (
2498                   ctx->Map.pcs[ 7 ] = ScoreTqReqSurrenderPriorityInherit_Pre_WaitState_Blocked;
2499                   ctx->Map.pcs[ 7 ] < ScoreTqReqSurrenderPriorityInherit_Pre_WaitState_NA;
2500                   ++ctx->Map.pcs[ 7 ]
2501                 ) {
2502                   ctx->Map.entry = ScoreTqReqSurrenderPriorityInherit_PopEntry(
2503                     ctx
2504                   );
2505 
2506                   if ( ctx->Map.entry.Skip ) {
2507                     continue;
2508                   }
2509 
2510                   ScoreTqReqSurrenderPriorityInherit_Prepare( ctx );
2511                   ScoreTqReqSurrenderPriorityInherit_TestVariant( ctx );
2512                   ScoreTqReqSurrenderPriorityInherit_Cleanup( ctx );
2513                 }
2514               }
2515             }
2516           }
2517         }
2518       }
2519     }
2520   }
2521 
2522   T_add_remark( &ScoreTqReqSurrenderPriorityInherit_Remark );
2523   T_pop_fixture();
2524 }
2525 
2526 /** @} */