Back to home page

LXR

 
 

    


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

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  * @file
0005  *
0006  * @ingroup RtemsSemReqSetPriority
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.h>
0056 #include <string.h>
0057 
0058 #include "ts-config.h"
0059 #include "tx-support.h"
0060 
0061 #include <rtems/test.h>
0062 
0063 /**
0064  * @defgroup RtemsSemReqSetPriority spec:/rtems/sem/req/set-priority
0065  *
0066  * @ingroup TestsuitesValidationNoClock0
0067  *
0068  * @{
0069  */
0070 
0071 typedef enum {
0072   RtemsSemReqSetPriority_Pre_Class_Counting,
0073   RtemsSemReqSetPriority_Pre_Class_Simple,
0074   RtemsSemReqSetPriority_Pre_Class_Binary,
0075   RtemsSemReqSetPriority_Pre_Class_PrioCeilingNoOwner,
0076   RtemsSemReqSetPriority_Pre_Class_PrioCeilingOwner,
0077   RtemsSemReqSetPriority_Pre_Class_PrioInherit,
0078   RtemsSemReqSetPriority_Pre_Class_MrsP,
0079   RtemsSemReqSetPriority_Pre_Class_NA
0080 } RtemsSemReqSetPriority_Pre_Class;
0081 
0082 typedef enum {
0083   RtemsSemReqSetPriority_Pre_SemId_Valid,
0084   RtemsSemReqSetPriority_Pre_SemId_Invalid,
0085   RtemsSemReqSetPriority_Pre_SemId_NA
0086 } RtemsSemReqSetPriority_Pre_SemId;
0087 
0088 typedef enum {
0089   RtemsSemReqSetPriority_Pre_SchedId_Invalid,
0090   RtemsSemReqSetPriority_Pre_SchedId_Create,
0091   RtemsSemReqSetPriority_Pre_SchedId_Other,
0092   RtemsSemReqSetPriority_Pre_SchedId_NA
0093 } RtemsSemReqSetPriority_Pre_SchedId;
0094 
0095 typedef enum {
0096   RtemsSemReqSetPriority_Pre_NewPrio_Current,
0097   RtemsSemReqSetPriority_Pre_NewPrio_Valid,
0098   RtemsSemReqSetPriority_Pre_NewPrio_Invalid,
0099   RtemsSemReqSetPriority_Pre_NewPrio_NA
0100 } RtemsSemReqSetPriority_Pre_NewPrio;
0101 
0102 typedef enum {
0103   RtemsSemReqSetPriority_Pre_OldPrio_Valid,
0104   RtemsSemReqSetPriority_Pre_OldPrio_Null,
0105   RtemsSemReqSetPriority_Pre_OldPrio_NA
0106 } RtemsSemReqSetPriority_Pre_OldPrio;
0107 
0108 typedef enum {
0109   RtemsSemReqSetPriority_Post_Status_Ok,
0110   RtemsSemReqSetPriority_Post_Status_InvAddr,
0111   RtemsSemReqSetPriority_Post_Status_InvId,
0112   RtemsSemReqSetPriority_Post_Status_InvPrio,
0113   RtemsSemReqSetPriority_Post_Status_NotDef,
0114   RtemsSemReqSetPriority_Post_Status_NA
0115 } RtemsSemReqSetPriority_Post_Status;
0116 
0117 typedef enum {
0118   RtemsSemReqSetPriority_Post_OwnerPrio_Nop,
0119   RtemsSemReqSetPriority_Post_OwnerPrio_New,
0120   RtemsSemReqSetPriority_Post_OwnerPrio_NA
0121 } RtemsSemReqSetPriority_Post_OwnerPrio;
0122 
0123 typedef enum {
0124   RtemsSemReqSetPriority_Post_SemPrio_Set,
0125   RtemsSemReqSetPriority_Post_SemPrio_Nop,
0126   RtemsSemReqSetPriority_Post_SemPrio_NA
0127 } RtemsSemReqSetPriority_Post_SemPrio;
0128 
0129 typedef enum {
0130   RtemsSemReqSetPriority_Post_OldPrioVar_Set,
0131   RtemsSemReqSetPriority_Post_OldPrioVar_Nop,
0132   RtemsSemReqSetPriority_Post_OldPrioVar_NA
0133 } RtemsSemReqSetPriority_Post_OldPrioVar;
0134 
0135 typedef struct {
0136   uint16_t Skip : 1;
0137   uint16_t Pre_Class_NA : 1;
0138   uint16_t Pre_SemId_NA : 1;
0139   uint16_t Pre_SchedId_NA : 1;
0140   uint16_t Pre_NewPrio_NA : 1;
0141   uint16_t Pre_OldPrio_NA : 1;
0142   uint16_t Post_Status : 3;
0143   uint16_t Post_OwnerPrio : 2;
0144   uint16_t Post_SemPrio : 2;
0145   uint16_t Post_OldPrioVar : 2;
0146 } RtemsSemReqSetPriority_Entry;
0147 
0148 /**
0149  * @brief Test context for spec:/rtems/sem/req/set-priority test case.
0150  */
0151 typedef struct {
0152   /**
0153    * @brief This member contains the scheduler identifier of the runner task.
0154    */
0155   rtems_id runner_scheduler_id;
0156 
0157   /**
0158    * @brief This member contains the scheduler identifier of a scheduler not
0159    *   used by the runner task.
0160    */
0161   rtems_id other_scheduler_id;
0162 
0163   /**
0164    * @brief This member specifies the initial count of the semaphore.
0165    */
0166   uint32_t count;
0167 
0168   /**
0169    * @brief This member specifies the attribute set of the semaphore.
0170    */
0171   rtems_attribute attribute_set;
0172 
0173   /**
0174    * @brief This member contains the semaphore identifier.
0175    */
0176   rtems_id the_semaphore_id;
0177 
0178   /**
0179    * @brief If this member is true, then the ``semaphore_id`` parameter value
0180    *   shall be associated with the semaphore, otherwise it shall be not
0181    *   associated with a semaphore.
0182    */
0183   bool valid_id;
0184 
0185   /**
0186    * @brief This member may contain the task priority returned by
0187    *   rtems_semaphore_set_priority().
0188    */
0189   rtems_task_priority old_priority_value;
0190 
0191   /**
0192    * @brief This member specifies the ``semaphore_id`` parameter for the
0193    *   rtems_semaphore_set_priority() call.
0194    */
0195   rtems_id semaphore_id;
0196 
0197   /**
0198    * @brief This member specifies the ``scheduler_id`` parameter for the
0199    *   rtems_semaphore_set_priority() call.
0200    */
0201   rtems_id scheduler_id;
0202 
0203   /**
0204    * @brief This member specifies the ``new_priority`` parameter for the
0205    *   rtems_semaphore_set_priority() call.
0206    */
0207   rtems_task_priority new_priority;
0208 
0209   /**
0210    * @brief This member specifies the ``old_priority`` parameter for the
0211    *   rtems_semaphore_set_priority() call.
0212    */
0213   rtems_task_priority *old_priority;
0214 
0215   /**
0216    * @brief This member contains the status of the
0217    *   rtems_semaphore_set_priority() call.
0218    */
0219   rtems_status_code status;
0220 
0221   struct {
0222     /**
0223      * @brief This member defines the pre-condition states for the next action.
0224      */
0225     size_t pcs[ 5 ];
0226 
0227     /**
0228      * @brief If this member is true, then the test action loop is executed.
0229      */
0230     bool in_action_loop;
0231 
0232     /**
0233      * @brief This member contains the next transition map index.
0234      */
0235     size_t index;
0236 
0237     /**
0238      * @brief This member contains the current transition map entry.
0239      */
0240     RtemsSemReqSetPriority_Entry entry;
0241 
0242     /**
0243      * @brief If this member is true, then the current transition variant
0244      *   should be skipped.
0245      */
0246     bool skip;
0247   } Map;
0248 } RtemsSemReqSetPriority_Context;
0249 
0250 static RtemsSemReqSetPriority_Context
0251   RtemsSemReqSetPriority_Instance;
0252 
0253 static const char * const RtemsSemReqSetPriority_PreDesc_Class[] = {
0254   "Counting",
0255   "Simple",
0256   "Binary",
0257   "PrioCeilingNoOwner",
0258   "PrioCeilingOwner",
0259   "PrioInherit",
0260   "MrsP",
0261   "NA"
0262 };
0263 
0264 static const char * const RtemsSemReqSetPriority_PreDesc_SemId[] = {
0265   "Valid",
0266   "Invalid",
0267   "NA"
0268 };
0269 
0270 static const char * const RtemsSemReqSetPriority_PreDesc_SchedId[] = {
0271   "Invalid",
0272   "Create",
0273   "Other",
0274   "NA"
0275 };
0276 
0277 static const char * const RtemsSemReqSetPriority_PreDesc_NewPrio[] = {
0278   "Current",
0279   "Valid",
0280   "Invalid",
0281   "NA"
0282 };
0283 
0284 static const char * const RtemsSemReqSetPriority_PreDesc_OldPrio[] = {
0285   "Valid",
0286   "Null",
0287   "NA"
0288 };
0289 
0290 static const char * const * const RtemsSemReqSetPriority_PreDesc[] = {
0291   RtemsSemReqSetPriority_PreDesc_Class,
0292   RtemsSemReqSetPriority_PreDesc_SemId,
0293   RtemsSemReqSetPriority_PreDesc_SchedId,
0294   RtemsSemReqSetPriority_PreDesc_NewPrio,
0295   RtemsSemReqSetPriority_PreDesc_OldPrio,
0296   NULL
0297 };
0298 
0299 #define NAME rtems_build_name( 'T', 'E', 'S', 'T' )
0300 
0301 typedef RtemsSemReqSetPriority_Context Context;
0302 
0303 static void ReleaseSemaphore( const Context *ctx )
0304 {
0305   rtems_status_code sc;
0306 
0307   sc = rtems_semaphore_release( ctx->the_semaphore_id );
0308   T_rsc_success( sc );
0309 }
0310 
0311 static void ChangeScheduler( rtems_id scheduler_id )
0312 {
0313 #if defined(RTEMS_SMP)
0314   rtems_status_code sc;
0315 
0316   sc = rtems_task_set_scheduler( RTEMS_SELF, scheduler_id, PRIO_NORMAL );
0317   T_rsc_success( sc );
0318 #else
0319   (void) scheduler_id;
0320 #endif
0321 }
0322 
0323 static void CheckPriority(
0324   const Context      *ctx,
0325   rtems_id            scheduler_id,
0326   rtems_task_priority priority
0327 )
0328 {
0329   rtems_status_code sc;
0330 
0331   ChangeScheduler( scheduler_id );
0332 
0333   sc = rtems_semaphore_obtain(
0334     ctx->the_semaphore_id,
0335     RTEMS_WAIT,
0336     RTEMS_NO_TIMEOUT
0337   );
0338   T_rsc_success( sc );
0339 
0340   T_eq_u32( GetSelfPriority(), priority );
0341 
0342   ReleaseSemaphore( ctx );
0343   ChangeScheduler( ctx->runner_scheduler_id );
0344 }
0345 
0346 static void CheckNotDefined(
0347   const Context      *ctx,
0348   rtems_id            scheduler_id
0349 )
0350 {
0351 #if defined(RTEMS_SMP)
0352   rtems_status_code sc;
0353 
0354   ChangeScheduler( scheduler_id );
0355 
0356   sc = rtems_semaphore_obtain(
0357     ctx->the_semaphore_id,
0358     RTEMS_WAIT,
0359     RTEMS_NO_TIMEOUT
0360   );
0361   T_rsc( sc, RTEMS_NOT_DEFINED );
0362 
0363   ChangeScheduler( ctx->runner_scheduler_id );
0364 #else
0365   (void) ctx;
0366   (void) scheduler_id;
0367 #endif
0368 }
0369 
0370 static void RtemsSemReqSetPriority_Pre_Class_Prepare(
0371   RtemsSemReqSetPriority_Context  *ctx,
0372   RtemsSemReqSetPriority_Pre_Class state
0373 )
0374 {
0375   switch ( state ) {
0376     case RtemsSemReqSetPriority_Pre_Class_Counting: {
0377       /*
0378        * While the semaphore object is a counting semaphore.
0379        */
0380       ctx->attribute_set |= RTEMS_COUNTING_SEMAPHORE;
0381       break;
0382     }
0383 
0384     case RtemsSemReqSetPriority_Pre_Class_Simple: {
0385       /*
0386        * While the semaphore object is a simple binary semaphore.
0387        */
0388       ctx->attribute_set |= RTEMS_SIMPLE_BINARY_SEMAPHORE;
0389       break;
0390     }
0391 
0392     case RtemsSemReqSetPriority_Pre_Class_Binary: {
0393       /*
0394        * While the semaphore object is a binary semaphore.
0395        */
0396       ctx->attribute_set |= RTEMS_BINARY_SEMAPHORE;
0397       break;
0398     }
0399 
0400     case RtemsSemReqSetPriority_Pre_Class_PrioCeilingNoOwner: {
0401       /*
0402        * While the semaphore object is a priority ceiling semaphore, while the
0403        * semaphore has no owner.
0404        */
0405       ctx->attribute_set |= RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY_CEILING;
0406       break;
0407     }
0408 
0409     case RtemsSemReqSetPriority_Pre_Class_PrioCeilingOwner: {
0410       /*
0411        * While the semaphore object is a priority ceiling semaphore, while the
0412        * semaphore has an owner.
0413        */
0414       ctx->attribute_set |= RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY_CEILING;
0415       ctx->count = 0;
0416       break;
0417     }
0418 
0419     case RtemsSemReqSetPriority_Pre_Class_PrioInherit: {
0420       /*
0421        * While the semaphore object is a priority inheritance semaphore.
0422        */
0423       ctx->attribute_set |= RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY;
0424       break;
0425     }
0426 
0427     case RtemsSemReqSetPriority_Pre_Class_MrsP: {
0428       /*
0429        * While the semaphore object is a MrsP semaphore.
0430        */
0431       ctx->attribute_set |= RTEMS_BINARY_SEMAPHORE |
0432         RTEMS_MULTIPROCESSOR_RESOURCE_SHARING;
0433       break;
0434     }
0435 
0436     case RtemsSemReqSetPriority_Pre_Class_NA:
0437       break;
0438   }
0439 }
0440 
0441 static void RtemsSemReqSetPriority_Pre_SemId_Prepare(
0442   RtemsSemReqSetPriority_Context  *ctx,
0443   RtemsSemReqSetPriority_Pre_SemId state
0444 )
0445 {
0446   switch ( state ) {
0447     case RtemsSemReqSetPriority_Pre_SemId_Valid: {
0448       /*
0449        * While the ``semaphore_id`` parameter is associated with the semaphore.
0450        */
0451       ctx->valid_id = true;
0452       break;
0453     }
0454 
0455     case RtemsSemReqSetPriority_Pre_SemId_Invalid: {
0456       /*
0457        * While the ``semaphore_id`` parameter is not associated with a
0458        * semaphore.
0459        */
0460       ctx->valid_id = false;
0461       break;
0462     }
0463 
0464     case RtemsSemReqSetPriority_Pre_SemId_NA:
0465       break;
0466   }
0467 }
0468 
0469 static void RtemsSemReqSetPriority_Pre_SchedId_Prepare(
0470   RtemsSemReqSetPriority_Context    *ctx,
0471   RtemsSemReqSetPriority_Pre_SchedId state
0472 )
0473 {
0474   switch ( state ) {
0475     case RtemsSemReqSetPriority_Pre_SchedId_Invalid: {
0476       /*
0477        * While the ``scheduler_id`` parameter is not associated with a
0478        * scheduler.
0479        */
0480       ctx->scheduler_id = INVALID_ID;
0481       break;
0482     }
0483 
0484     case RtemsSemReqSetPriority_Pre_SchedId_Create: {
0485       /*
0486        * While the ``scheduler_id`` parameter is associated with the scheduler
0487        * used to create the semaphore.
0488        */
0489       ctx->scheduler_id = ctx->runner_scheduler_id;
0490       break;
0491     }
0492 
0493     case RtemsSemReqSetPriority_Pre_SchedId_Other: {
0494       /*
0495        * While the ``scheduler_id`` parameter is associated with a scheduler
0496        * other than the one used to create the semaphore.
0497        */
0498       ctx->scheduler_id = ctx->other_scheduler_id;
0499       break;
0500     }
0501 
0502     case RtemsSemReqSetPriority_Pre_SchedId_NA:
0503       break;
0504   }
0505 }
0506 
0507 static void RtemsSemReqSetPriority_Pre_NewPrio_Prepare(
0508   RtemsSemReqSetPriority_Context    *ctx,
0509   RtemsSemReqSetPriority_Pre_NewPrio state
0510 )
0511 {
0512   switch ( state ) {
0513     case RtemsSemReqSetPriority_Pre_NewPrio_Current: {
0514       /*
0515        * While the ``new_priority`` parameter is equal to
0516        * RTEMS_CURRENT_PRIORITY.
0517        */
0518       ctx->new_priority = RTEMS_CURRENT_PRIORITY;
0519       break;
0520     }
0521 
0522     case RtemsSemReqSetPriority_Pre_NewPrio_Valid: {
0523       /*
0524        * While the ``new_priority`` parameter is not equal to
0525        * RTEMS_CURRENT_PRIORITY and valid with respect to the scheduler
0526        * specified by the ``scheduler_id`` parameter.
0527        */
0528       ctx->new_priority = PRIO_VERY_HIGH;
0529       break;
0530     }
0531 
0532     case RtemsSemReqSetPriority_Pre_NewPrio_Invalid: {
0533       /*
0534        * While the ``new_priority`` parameter is invalid with respect to the
0535        * scheduler specified by the ``scheduler_id`` parameter.
0536        */
0537       ctx->new_priority = PRIO_INVALID;
0538       break;
0539     }
0540 
0541     case RtemsSemReqSetPriority_Pre_NewPrio_NA:
0542       break;
0543   }
0544 }
0545 
0546 static void RtemsSemReqSetPriority_Pre_OldPrio_Prepare(
0547   RtemsSemReqSetPriority_Context    *ctx,
0548   RtemsSemReqSetPriority_Pre_OldPrio state
0549 )
0550 {
0551   switch ( state ) {
0552     case RtemsSemReqSetPriority_Pre_OldPrio_Valid: {
0553       /*
0554        * While the ``old_priority`` parameter references an object of type
0555        * rtems_task_priority.
0556        */
0557       ctx->old_priority = &ctx->old_priority_value;
0558       break;
0559     }
0560 
0561     case RtemsSemReqSetPriority_Pre_OldPrio_Null: {
0562       /*
0563        * While the ``old_priority`` parameter is NULL.
0564        */
0565       ctx->old_priority = NULL;
0566       break;
0567     }
0568 
0569     case RtemsSemReqSetPriority_Pre_OldPrio_NA:
0570       break;
0571   }
0572 }
0573 
0574 static void RtemsSemReqSetPriority_Post_Status_Check(
0575   RtemsSemReqSetPriority_Context    *ctx,
0576   RtemsSemReqSetPriority_Post_Status state
0577 )
0578 {
0579   switch ( state ) {
0580     case RtemsSemReqSetPriority_Post_Status_Ok: {
0581       /*
0582        * The return status of rtems_semaphore_set_priority() shall be
0583        * RTEMS_SUCCESSFUL.
0584        */
0585       T_rsc_success( ctx->status );
0586       break;
0587     }
0588 
0589     case RtemsSemReqSetPriority_Post_Status_InvAddr: {
0590       /*
0591        * The return status of rtems_semaphore_set_priority() shall be
0592        * RTEMS_INVALID_ADDRESS.
0593        */
0594       T_rsc( ctx->status, RTEMS_INVALID_ADDRESS );
0595       break;
0596     }
0597 
0598     case RtemsSemReqSetPriority_Post_Status_InvId: {
0599       /*
0600        * The return status of rtems_semaphore_set_priority() shall be
0601        * RTEMS_INVALID_ID.
0602        */
0603       T_rsc( ctx->status, RTEMS_INVALID_ID );
0604       break;
0605     }
0606 
0607     case RtemsSemReqSetPriority_Post_Status_InvPrio: {
0608       /*
0609        * The return status of rtems_semaphore_set_priority() shall be
0610        * RTEMS_INVALID_PRIORITY.
0611        */
0612       T_rsc( ctx->status, RTEMS_INVALID_PRIORITY );
0613       break;
0614     }
0615 
0616     case RtemsSemReqSetPriority_Post_Status_NotDef: {
0617       /*
0618        * The return status of rtems_semaphore_set_priority() shall be
0619        * RTEMS_NOT_DEFINED.
0620        */
0621       T_rsc( ctx->status, RTEMS_NOT_DEFINED );
0622       break;
0623     }
0624 
0625     case RtemsSemReqSetPriority_Post_Status_NA:
0626       break;
0627   }
0628 }
0629 
0630 static void RtemsSemReqSetPriority_Post_OwnerPrio_Check(
0631   RtemsSemReqSetPriority_Context       *ctx,
0632   RtemsSemReqSetPriority_Post_OwnerPrio state
0633 )
0634 {
0635   switch ( state ) {
0636     case RtemsSemReqSetPriority_Post_OwnerPrio_Nop: {
0637       /*
0638        * The current priority of the owner task of the semaphore for the
0639        * scheduler specified by the ``scheduler_id`` parameter shall not be
0640        * modified by the rtems_semaphore_set_priority() call.
0641        */
0642       T_eq_u32( GetSelfPriority(), PRIO_HIGH );
0643       ReleaseSemaphore( ctx );
0644       break;
0645     }
0646 
0647     case RtemsSemReqSetPriority_Post_OwnerPrio_New: {
0648       /*
0649        * The current priority of the owner task of the semaphore for the
0650        * scheduler specified by the ``scheduler_id`` parameter shall be less
0651        * than or equal to the value of the ``new_priority`` parameter.
0652        */
0653       T_eq_u32( GetSelfPriority(), PRIO_VERY_HIGH );
0654       ReleaseSemaphore( ctx );
0655       break;
0656     }
0657 
0658     case RtemsSemReqSetPriority_Post_OwnerPrio_NA:
0659       break;
0660   }
0661 }
0662 
0663 static void RtemsSemReqSetPriority_Post_SemPrio_Check(
0664   RtemsSemReqSetPriority_Context     *ctx,
0665   RtemsSemReqSetPriority_Post_SemPrio state
0666 )
0667 {
0668   switch ( state ) {
0669     case RtemsSemReqSetPriority_Post_SemPrio_Set: {
0670       /*
0671        * The priority used for the scheduler specified by the ``scheduler_id``
0672        * parameter of the semaphore associated with the identifier specified by
0673        * the ``semaphore_id`` parameter shall be set to the prioriy specified
0674        * by the ``new_priority`` parameter during the
0675        * rtems_semaphore_set_priority() call.
0676        */
0677       if ( ( ctx->attribute_set & RTEMS_MULTIPROCESSOR_RESOURCE_SHARING ) != 0 ) {
0678         if ( ctx->scheduler_id == ctx->other_scheduler_id ) {
0679           CheckPriority( ctx, ctx->runner_scheduler_id, PRIO_HIGH );
0680           CheckPriority( ctx, ctx->other_scheduler_id, PRIO_VERY_HIGH );
0681         } else {
0682           CheckPriority( ctx, ctx->runner_scheduler_id, PRIO_VERY_HIGH );
0683       #if defined(RTEMS_SMP)
0684           CheckPriority( ctx, ctx->other_scheduler_id, 0 );
0685       #endif
0686         }
0687       } else if ( ( ctx->attribute_set & RTEMS_PRIORITY_CEILING ) != 0 ) {
0688         CheckPriority( ctx, ctx->runner_scheduler_id, PRIO_VERY_HIGH );
0689         CheckNotDefined( ctx, ctx->other_scheduler_id );
0690       }
0691       break;
0692     }
0693 
0694     case RtemsSemReqSetPriority_Post_SemPrio_Nop: {
0695       /*
0696        * Priorities used by semaphores shall not be modified by the
0697        * rtems_semaphore_set_priority() call.
0698        */
0699       if ( ( ctx->attribute_set & RTEMS_MULTIPROCESSOR_RESOURCE_SHARING ) != 0 ) {
0700         CheckPriority( ctx, ctx->runner_scheduler_id, PRIO_HIGH );
0701       #if defined(RTEMS_SMP)
0702         CheckPriority( ctx, ctx->other_scheduler_id, 0 );
0703       #endif
0704       } else if ( ( ctx->attribute_set & RTEMS_PRIORITY_CEILING ) != 0 ) {
0705         CheckPriority( ctx, ctx->runner_scheduler_id, PRIO_HIGH );
0706         CheckNotDefined( ctx, ctx->other_scheduler_id );
0707       }
0708       break;
0709     }
0710 
0711     case RtemsSemReqSetPriority_Post_SemPrio_NA:
0712       break;
0713   }
0714 }
0715 
0716 static void RtemsSemReqSetPriority_Post_OldPrioVar_Check(
0717   RtemsSemReqSetPriority_Context        *ctx,
0718   RtemsSemReqSetPriority_Post_OldPrioVar state
0719 )
0720 {
0721   switch ( state ) {
0722     case RtemsSemReqSetPriority_Post_OldPrioVar_Set: {
0723       /*
0724        * The value of the object referenced by the ``old_priority`` parameter
0725        * shall be set to the priority used for the scheduler specified by the
0726        * ``scheduler_id`` parameter of the semaphore associated with the
0727        * identifier specified by the ``semaphore_id`` parameter right before
0728        * the priority is set by the rtems_semaphore_set_priority() call.
0729        */
0730       T_eq_ptr( ctx->old_priority, &ctx->old_priority_value );
0731 
0732       if ( ctx->scheduler_id == ctx->other_scheduler_id ) {
0733         T_eq_u32( ctx->old_priority_value, 0 );
0734       } else {
0735         T_eq_u32( ctx->old_priority_value, PRIO_HIGH );
0736       }
0737       break;
0738     }
0739 
0740     case RtemsSemReqSetPriority_Post_OldPrioVar_Nop: {
0741       /*
0742        * Objects referenced by the ``old_priority`` parameter in past calls to
0743        * rtems_semaphore_set_priority() shall not be accessed by the
0744        * rtems_semaphore_set_priority() call.
0745        */
0746       T_eq_u32( ctx->old_priority_value, PRIO_INVALID );
0747       break;
0748     }
0749 
0750     case RtemsSemReqSetPriority_Post_OldPrioVar_NA:
0751       break;
0752   }
0753 }
0754 
0755 static void RtemsSemReqSetPriority_Setup( RtemsSemReqSetPriority_Context *ctx )
0756 {
0757   rtems_status_code sc;
0758 
0759   memset( ctx, 0, sizeof( *ctx ) );
0760   SetSelfPriority( PRIO_NORMAL );
0761 
0762   sc = rtems_task_get_scheduler( RTEMS_SELF, &ctx->runner_scheduler_id );
0763   T_rsc_success( sc );
0764 
0765   #if defined(RTEMS_SMP)
0766   sc = rtems_scheduler_ident(
0767     TEST_SCHEDULER_B_NAME,
0768     &ctx->other_scheduler_id
0769   );
0770   T_rsc_success( sc );
0771   #else
0772   ctx->other_scheduler_id = INVALID_ID;
0773   #endif
0774 }
0775 
0776 static void RtemsSemReqSetPriority_Setup_Wrap( void *arg )
0777 {
0778   RtemsSemReqSetPriority_Context *ctx;
0779 
0780   ctx = arg;
0781   ctx->Map.in_action_loop = false;
0782   RtemsSemReqSetPriority_Setup( ctx );
0783 }
0784 
0785 static void RtemsSemReqSetPriority_Teardown(
0786   RtemsSemReqSetPriority_Context *ctx
0787 )
0788 {
0789   RestoreRunnerPriority();
0790 }
0791 
0792 static void RtemsSemReqSetPriority_Teardown_Wrap( void *arg )
0793 {
0794   RtemsSemReqSetPriority_Context *ctx;
0795 
0796   ctx = arg;
0797   ctx->Map.in_action_loop = false;
0798   RtemsSemReqSetPriority_Teardown( ctx );
0799 }
0800 
0801 static void RtemsSemReqSetPriority_Prepare(
0802   RtemsSemReqSetPriority_Context *ctx
0803 )
0804 {
0805   ctx->old_priority_value = PRIO_INVALID;
0806   ctx->count = 1;
0807   ctx->attribute_set = RTEMS_PRIORITY;
0808   ctx->valid_id = true;
0809 }
0810 
0811 static void RtemsSemReqSetPriority_Action(
0812   RtemsSemReqSetPriority_Context *ctx
0813 )
0814 {
0815   rtems_status_code sc;
0816 
0817   sc = rtems_semaphore_create(
0818     NAME,
0819     ctx->count,
0820     ctx->attribute_set,
0821     PRIO_HIGH,
0822     &ctx->the_semaphore_id
0823   );
0824   T_rsc_success( sc );
0825 
0826   if ( ctx->valid_id ) {
0827     ctx->semaphore_id = ctx->the_semaphore_id;
0828   } else {
0829     ctx->semaphore_id = INVALID_ID;
0830   }
0831 
0832   ctx->status = rtems_semaphore_set_priority(
0833     ctx->semaphore_id,
0834     ctx->scheduler_id,
0835     ctx->new_priority,
0836     ctx->old_priority
0837   );
0838 }
0839 
0840 static void RtemsSemReqSetPriority_Cleanup(
0841   RtemsSemReqSetPriority_Context *ctx
0842 )
0843 {
0844   rtems_status_code sc;
0845 
0846   T_eq_u32( GetSelfPriority(), PRIO_NORMAL );
0847 
0848   sc = rtems_semaphore_delete( ctx->the_semaphore_id );
0849   T_rsc_success( sc );
0850 }
0851 
0852 static const RtemsSemReqSetPriority_Entry
0853 RtemsSemReqSetPriority_Entries[] = {
0854   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_InvAddr,
0855     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0856     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0857     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0858   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_InvId,
0859     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0860     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0861     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0862 #if defined(RTEMS_SMP)
0863   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_InvAddr,
0864     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0865     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0866     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0867 #else
0868   { 1, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_NA,
0869     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0870     RtemsSemReqSetPriority_Post_SemPrio_NA,
0871     RtemsSemReqSetPriority_Post_OldPrioVar_NA },
0872 #endif
0873 #if defined(RTEMS_SMP)
0874   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_InvId,
0875     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0876     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0877     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0878 #else
0879   { 1, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_NA,
0880     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0881     RtemsSemReqSetPriority_Post_SemPrio_NA,
0882     RtemsSemReqSetPriority_Post_OldPrioVar_NA },
0883 #endif
0884   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_InvAddr,
0885     RtemsSemReqSetPriority_Post_OwnerPrio_Nop,
0886     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0887     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0888 #if defined(RTEMS_SMP)
0889   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_NotDef,
0890     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0891     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0892     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0893 #else
0894   { 1, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_NA,
0895     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0896     RtemsSemReqSetPriority_Post_SemPrio_NA,
0897     RtemsSemReqSetPriority_Post_OldPrioVar_NA },
0898 #endif
0899   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_InvId,
0900     RtemsSemReqSetPriority_Post_OwnerPrio_Nop,
0901     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0902     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0903   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_NotDef,
0904     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0905     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0906     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0907   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_InvPrio,
0908     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0909     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0910     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0911 #if defined(RTEMS_SMP)
0912   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_InvPrio,
0913     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0914     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0915     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0916 #else
0917   { 1, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_NA,
0918     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0919     RtemsSemReqSetPriority_Post_SemPrio_NA,
0920     RtemsSemReqSetPriority_Post_OldPrioVar_NA },
0921 #endif
0922 #if defined(RTEMS_SMP)
0923   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_InvAddr,
0924     RtemsSemReqSetPriority_Post_OwnerPrio_Nop,
0925     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0926     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0927 #else
0928   { 1, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_NA,
0929     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0930     RtemsSemReqSetPriority_Post_SemPrio_NA,
0931     RtemsSemReqSetPriority_Post_OldPrioVar_NA },
0932 #endif
0933 #if defined(RTEMS_SMP)
0934   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_InvId,
0935     RtemsSemReqSetPriority_Post_OwnerPrio_Nop,
0936     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0937     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0938 #else
0939   { 1, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_NA,
0940     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0941     RtemsSemReqSetPriority_Post_SemPrio_NA,
0942     RtemsSemReqSetPriority_Post_OldPrioVar_NA },
0943 #endif
0944   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_Ok,
0945     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0946     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0947     RtemsSemReqSetPriority_Post_OldPrioVar_Set },
0948   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_Ok,
0949     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0950     RtemsSemReqSetPriority_Post_SemPrio_Set,
0951     RtemsSemReqSetPriority_Post_OldPrioVar_Set },
0952 #if defined(RTEMS_SMP)
0953   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_NotDef,
0954     RtemsSemReqSetPriority_Post_OwnerPrio_Nop,
0955     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0956     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0957 #else
0958   { 1, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_NA,
0959     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0960     RtemsSemReqSetPriority_Post_SemPrio_NA,
0961     RtemsSemReqSetPriority_Post_OldPrioVar_NA },
0962 #endif
0963   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_Ok,
0964     RtemsSemReqSetPriority_Post_OwnerPrio_Nop,
0965     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0966     RtemsSemReqSetPriority_Post_OldPrioVar_Set },
0967   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_Ok,
0968     RtemsSemReqSetPriority_Post_OwnerPrio_New,
0969     RtemsSemReqSetPriority_Post_SemPrio_Set,
0970     RtemsSemReqSetPriority_Post_OldPrioVar_Set },
0971   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_InvPrio,
0972     RtemsSemReqSetPriority_Post_OwnerPrio_Nop,
0973     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0974     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0975 #if defined(RTEMS_SMP)
0976   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_InvPrio,
0977     RtemsSemReqSetPriority_Post_OwnerPrio_Nop,
0978     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0979     RtemsSemReqSetPriority_Post_OldPrioVar_Nop },
0980 #else
0981   { 1, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_NA,
0982     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0983     RtemsSemReqSetPriority_Post_SemPrio_NA,
0984     RtemsSemReqSetPriority_Post_OldPrioVar_NA },
0985 #endif
0986 #if defined(RTEMS_SMP)
0987   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_Ok,
0988     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0989     RtemsSemReqSetPriority_Post_SemPrio_Nop,
0990     RtemsSemReqSetPriority_Post_OldPrioVar_Set },
0991 #else
0992   { 1, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_NA,
0993     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
0994     RtemsSemReqSetPriority_Post_SemPrio_NA,
0995     RtemsSemReqSetPriority_Post_OldPrioVar_NA },
0996 #endif
0997 #if defined(RTEMS_SMP)
0998   { 0, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_Ok,
0999     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
1000     RtemsSemReqSetPriority_Post_SemPrio_Set,
1001     RtemsSemReqSetPriority_Post_OldPrioVar_Set }
1002 #else
1003   { 1, 0, 0, 0, 0, 0, RtemsSemReqSetPriority_Post_Status_NA,
1004     RtemsSemReqSetPriority_Post_OwnerPrio_NA,
1005     RtemsSemReqSetPriority_Post_SemPrio_NA,
1006     RtemsSemReqSetPriority_Post_OldPrioVar_NA }
1007 #endif
1008 };
1009 
1010 static const uint8_t
1011 RtemsSemReqSetPriority_Map[] = {
1012   1, 0, 1, 0, 1, 0, 7, 0, 7, 0, 8, 0, 5, 2, 5, 2, 9, 2, 1, 0, 1, 0, 1, 0, 1, 0,
1013   1, 0, 1, 0, 3, 2, 3, 2, 3, 2, 1, 0, 1, 0, 1, 0, 7, 0, 7, 0, 8, 0, 5, 2, 5, 2,
1014   9, 2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 2, 3, 2, 3, 2, 1, 0, 1, 0, 1, 0,
1015   7, 0, 7, 0, 8, 0, 5, 2, 5, 2, 9, 2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 2,
1016   3, 2, 3, 2, 1, 0, 1, 0, 1, 0, 12, 0, 13, 0, 8, 0, 5, 2, 5, 2, 9, 2, 1, 0, 1,
1017   0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 2, 3, 2, 3, 2, 6, 4, 6, 4, 6, 4, 15, 4, 16, 4,
1018   17, 4, 14, 10, 14, 10, 18, 10, 6, 4, 6, 4, 6, 4, 6, 4, 6, 4, 6, 4, 11, 10,
1019   11, 10, 11, 10, 1, 0, 1, 0, 1, 0, 7, 0, 7, 0, 8, 0, 5, 2, 5, 2, 9, 2, 1, 0,
1020   1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 2, 3, 2, 3, 2, 1, 0, 1, 0, 1, 0, 12, 0, 13,
1021   0, 8, 0, 19, 2, 20, 2, 9, 2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 2, 3, 2,
1022   3, 2
1023 };
1024 
1025 static size_t RtemsSemReqSetPriority_Scope( void *arg, char *buf, size_t n )
1026 {
1027   RtemsSemReqSetPriority_Context *ctx;
1028 
1029   ctx = arg;
1030 
1031   if ( ctx->Map.in_action_loop ) {
1032     return T_get_scope( RtemsSemReqSetPriority_PreDesc, buf, n, ctx->Map.pcs );
1033   }
1034 
1035   return 0;
1036 }
1037 
1038 static T_fixture RtemsSemReqSetPriority_Fixture = {
1039   .setup = RtemsSemReqSetPriority_Setup_Wrap,
1040   .stop = NULL,
1041   .teardown = RtemsSemReqSetPriority_Teardown_Wrap,
1042   .scope = RtemsSemReqSetPriority_Scope,
1043   .initial_context = &RtemsSemReqSetPriority_Instance
1044 };
1045 
1046 static inline RtemsSemReqSetPriority_Entry RtemsSemReqSetPriority_PopEntry(
1047   RtemsSemReqSetPriority_Context *ctx
1048 )
1049 {
1050   size_t index;
1051 
1052   index = ctx->Map.index;
1053   ctx->Map.index = index + 1;
1054   return RtemsSemReqSetPriority_Entries[
1055     RtemsSemReqSetPriority_Map[ index ]
1056   ];
1057 }
1058 
1059 static void RtemsSemReqSetPriority_TestVariant(
1060   RtemsSemReqSetPriority_Context *ctx
1061 )
1062 {
1063   RtemsSemReqSetPriority_Pre_Class_Prepare( ctx, ctx->Map.pcs[ 0 ] );
1064   RtemsSemReqSetPriority_Pre_SemId_Prepare( ctx, ctx->Map.pcs[ 1 ] );
1065   RtemsSemReqSetPriority_Pre_SchedId_Prepare( ctx, ctx->Map.pcs[ 2 ] );
1066   RtemsSemReqSetPriority_Pre_NewPrio_Prepare( ctx, ctx->Map.pcs[ 3 ] );
1067   RtemsSemReqSetPriority_Pre_OldPrio_Prepare( ctx, ctx->Map.pcs[ 4 ] );
1068   RtemsSemReqSetPriority_Action( ctx );
1069   RtemsSemReqSetPriority_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
1070   RtemsSemReqSetPriority_Post_OwnerPrio_Check(
1071     ctx,
1072     ctx->Map.entry.Post_OwnerPrio
1073   );
1074   RtemsSemReqSetPriority_Post_SemPrio_Check(
1075     ctx,
1076     ctx->Map.entry.Post_SemPrio
1077   );
1078   RtemsSemReqSetPriority_Post_OldPrioVar_Check(
1079     ctx,
1080     ctx->Map.entry.Post_OldPrioVar
1081   );
1082 }
1083 
1084 /**
1085  * @fn void T_case_body_RtemsSemReqSetPriority( void )
1086  */
1087 T_TEST_CASE_FIXTURE( RtemsSemReqSetPriority, &RtemsSemReqSetPriority_Fixture )
1088 {
1089   RtemsSemReqSetPriority_Context *ctx;
1090 
1091   ctx = T_fixture_context();
1092   ctx->Map.in_action_loop = true;
1093   ctx->Map.index = 0;
1094 
1095   for (
1096     ctx->Map.pcs[ 0 ] = RtemsSemReqSetPriority_Pre_Class_Counting;
1097     ctx->Map.pcs[ 0 ] < RtemsSemReqSetPriority_Pre_Class_NA;
1098     ++ctx->Map.pcs[ 0 ]
1099   ) {
1100     for (
1101       ctx->Map.pcs[ 1 ] = RtemsSemReqSetPriority_Pre_SemId_Valid;
1102       ctx->Map.pcs[ 1 ] < RtemsSemReqSetPriority_Pre_SemId_NA;
1103       ++ctx->Map.pcs[ 1 ]
1104     ) {
1105       for (
1106         ctx->Map.pcs[ 2 ] = RtemsSemReqSetPriority_Pre_SchedId_Invalid;
1107         ctx->Map.pcs[ 2 ] < RtemsSemReqSetPriority_Pre_SchedId_NA;
1108         ++ctx->Map.pcs[ 2 ]
1109       ) {
1110         for (
1111           ctx->Map.pcs[ 3 ] = RtemsSemReqSetPriority_Pre_NewPrio_Current;
1112           ctx->Map.pcs[ 3 ] < RtemsSemReqSetPriority_Pre_NewPrio_NA;
1113           ++ctx->Map.pcs[ 3 ]
1114         ) {
1115           for (
1116             ctx->Map.pcs[ 4 ] = RtemsSemReqSetPriority_Pre_OldPrio_Valid;
1117             ctx->Map.pcs[ 4 ] < RtemsSemReqSetPriority_Pre_OldPrio_NA;
1118             ++ctx->Map.pcs[ 4 ]
1119           ) {
1120             ctx->Map.entry = RtemsSemReqSetPriority_PopEntry( ctx );
1121 
1122             if ( ctx->Map.entry.Skip ) {
1123               continue;
1124             }
1125 
1126             RtemsSemReqSetPriority_Prepare( ctx );
1127             RtemsSemReqSetPriority_TestVariant( ctx );
1128             RtemsSemReqSetPriority_Cleanup( ctx );
1129           }
1130         }
1131       }
1132     }
1133   }
1134 }
1135 
1136 /** @} */