Back to home page

LXR

 
 

    


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

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  * @file
0005  *
0006  * @ingroup RtemsIntrReqEntryRemove
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 <bsp/irq-generic.h>
0056 #include <rtems/irq-extension.h>
0057 
0058 #include "tx-support.h"
0059 
0060 #include <rtems/test.h>
0061 
0062 /**
0063  * @defgroup RtemsIntrReqEntryRemove spec:/rtems/intr/req/entry-remove
0064  *
0065  * @ingroup TestsuitesValidationIntr
0066  *
0067  * @{
0068  */
0069 
0070 typedef enum {
0071   RtemsIntrReqEntryRemove_Pre_Vector_Valid,
0072   RtemsIntrReqEntryRemove_Pre_Vector_Invalid,
0073   RtemsIntrReqEntryRemove_Pre_Vector_NA
0074 } RtemsIntrReqEntryRemove_Pre_Vector;
0075 
0076 typedef enum {
0077   RtemsIntrReqEntryRemove_Pre_Entry_Obj,
0078   RtemsIntrReqEntryRemove_Pre_Entry_Null,
0079   RtemsIntrReqEntryRemove_Pre_Entry_NA
0080 } RtemsIntrReqEntryRemove_Pre_Entry;
0081 
0082 typedef enum {
0083   RtemsIntrReqEntryRemove_Pre_Routine_Valid,
0084   RtemsIntrReqEntryRemove_Pre_Routine_Null,
0085   RtemsIntrReqEntryRemove_Pre_Routine_NA
0086 } RtemsIntrReqEntryRemove_Pre_Routine;
0087 
0088 typedef enum {
0089   RtemsIntrReqEntryRemove_Pre_EntryObj_Installed,
0090   RtemsIntrReqEntryRemove_Pre_EntryObj_Match,
0091   RtemsIntrReqEntryRemove_Pre_EntryObj_NoMatch,
0092   RtemsIntrReqEntryRemove_Pre_EntryObj_NA
0093 } RtemsIntrReqEntryRemove_Pre_EntryObj;
0094 
0095 typedef enum {
0096   RtemsIntrReqEntryRemove_Pre_Init_Yes,
0097   RtemsIntrReqEntryRemove_Pre_Init_No,
0098   RtemsIntrReqEntryRemove_Pre_Init_NA
0099 } RtemsIntrReqEntryRemove_Pre_Init;
0100 
0101 typedef enum {
0102   RtemsIntrReqEntryRemove_Pre_ISR_Yes,
0103   RtemsIntrReqEntryRemove_Pre_ISR_No,
0104   RtemsIntrReqEntryRemove_Pre_ISR_NA
0105 } RtemsIntrReqEntryRemove_Pre_ISR;
0106 
0107 typedef enum {
0108   RtemsIntrReqEntryRemove_Pre_CanDisable_Yes,
0109   RtemsIntrReqEntryRemove_Pre_CanDisable_Maybe,
0110   RtemsIntrReqEntryRemove_Pre_CanDisable_No,
0111   RtemsIntrReqEntryRemove_Pre_CanDisable_NA
0112 } RtemsIntrReqEntryRemove_Pre_CanDisable;
0113 
0114 typedef enum {
0115   RtemsIntrReqEntryRemove_Pre_First_Yes,
0116   RtemsIntrReqEntryRemove_Pre_First_No,
0117   RtemsIntrReqEntryRemove_Pre_First_NA
0118 } RtemsIntrReqEntryRemove_Pre_First;
0119 
0120 typedef enum {
0121   RtemsIntrReqEntryRemove_Pre_Last_Yes,
0122   RtemsIntrReqEntryRemove_Pre_Last_No,
0123   RtemsIntrReqEntryRemove_Pre_Last_NA
0124 } RtemsIntrReqEntryRemove_Pre_Last;
0125 
0126 typedef enum {
0127   RtemsIntrReqEntryRemove_Post_Status_Ok,
0128   RtemsIntrReqEntryRemove_Post_Status_InvAddr,
0129   RtemsIntrReqEntryRemove_Post_Status_IncStat,
0130   RtemsIntrReqEntryRemove_Post_Status_InvId,
0131   RtemsIntrReqEntryRemove_Post_Status_CalledFromISR,
0132   RtemsIntrReqEntryRemove_Post_Status_Unsat,
0133   RtemsIntrReqEntryRemove_Post_Status_NA
0134 } RtemsIntrReqEntryRemove_Post_Status;
0135 
0136 typedef enum {
0137   RtemsIntrReqEntryRemove_Post_Disabled_Nop,
0138   RtemsIntrReqEntryRemove_Post_Disabled_Yes,
0139   RtemsIntrReqEntryRemove_Post_Disabled_Maybe,
0140   RtemsIntrReqEntryRemove_Post_Disabled_No,
0141   RtemsIntrReqEntryRemove_Post_Disabled_NA
0142 } RtemsIntrReqEntryRemove_Post_Disabled;
0143 
0144 typedef enum {
0145   RtemsIntrReqEntryRemove_Post_Installed_No,
0146   RtemsIntrReqEntryRemove_Post_Installed_Nop,
0147   RtemsIntrReqEntryRemove_Post_Installed_NA
0148 } RtemsIntrReqEntryRemove_Post_Installed;
0149 
0150 typedef struct {
0151   uint32_t Skip : 1;
0152   uint32_t Pre_Vector_NA : 1;
0153   uint32_t Pre_Entry_NA : 1;
0154   uint32_t Pre_Routine_NA : 1;
0155   uint32_t Pre_EntryObj_NA : 1;
0156   uint32_t Pre_Init_NA : 1;
0157   uint32_t Pre_ISR_NA : 1;
0158   uint32_t Pre_CanDisable_NA : 1;
0159   uint32_t Pre_First_NA : 1;
0160   uint32_t Pre_Last_NA : 1;
0161   uint32_t Post_Status : 3;
0162   uint32_t Post_Disabled : 3;
0163   uint32_t Post_Installed : 2;
0164 } RtemsIntrReqEntryRemove_Entry;
0165 
0166 /**
0167  * @brief Test context for spec:/rtems/intr/req/entry-remove test case.
0168  */
0169 typedef struct {
0170   /**
0171    * @brief If this member is true, then the service was initialized during
0172    *   setup.
0173    */
0174   bool initialized_during_setup;
0175 
0176   /**
0177    * @brief If this member is true, then an interrupt occurred.
0178    */
0179   bool interrupt_occurred;
0180 
0181   /**
0182    * @brief This member provides a counter incremented by EntryRoutine().
0183    */
0184   uint32_t entry_counter;
0185 
0186   /**
0187    * @brief This member provides another rtems_interrupt_entry object.
0188    */
0189   rtems_interrupt_entry other_entry;
0190 
0191   /**
0192    * @brief If this member is true, then another entry was installed.
0193    */
0194   bool other_installed;
0195 
0196   /**
0197    * @brief This member provides a third rtems_interrupt_entry object.
0198    */
0199   rtems_interrupt_entry third_entry;
0200 
0201   /**
0202    * @brief If this member is true, then a third entry was installed.
0203    */
0204   bool third_installed;
0205 
0206   /**
0207    * @brief If this member is true, then the entry is installed.
0208    */
0209   bool installed;
0210 
0211   /**
0212    * @brief If this member is true, then the entry is installed as the first
0213    *   entry.
0214    */
0215   bool first;
0216 
0217   /**
0218    * @brief If this member is true, then the entry is installed as the last
0219    *   entry.
0220    */
0221   bool last;
0222 
0223   /**
0224    * @brief If this member is true, then the entry matches with another
0225    *   installed entry.
0226    */
0227   bool match;
0228 
0229   /**
0230    * @brief This member provides the vector number of a testable interrupt
0231    *   vector.
0232    */
0233   rtems_vector_number test_vector;
0234 
0235   /**
0236    * @brief If this member is true, then the testable interrupt vector was
0237    *   enabled at the test case begin.
0238    */
0239   bool test_vector_was_enabled;
0240 
0241   /**
0242    * @brief This member provides the attributes of the testable interrupt
0243    *   vector.
0244    */
0245   rtems_interrupt_attributes attributes;
0246 
0247   /**
0248    * @brief If this member is true, then the service shall be initialized.
0249    */
0250   bool initialized;
0251 
0252   /**
0253    * @brief If this member is true, then rtems_interrupt_entry_remove() shall
0254    *   be called from within interrupt context.
0255    */
0256   bool isr;
0257 
0258   /**
0259    * @brief This member contains the enabled status before the
0260    *   rtems_interrupt_entry_remove() call.
0261    */
0262   bool enabled_before;
0263 
0264   /**
0265    * @brief This member contains the enabled status after the
0266    *   rtems_interrupt_entry_remove() call.
0267    */
0268   bool enabled_after;
0269 
0270   /**
0271    * @brief This member provides the count of visited entries.
0272    */
0273   uint32_t visited_entries;
0274 
0275   /**
0276    * @brief This member provides the rtems_interrupt_entry object.
0277    */
0278   rtems_interrupt_entry entry_obj;
0279 
0280   /**
0281    * @brief This member specifies if the ``vector`` parameter value.
0282    */
0283   rtems_vector_number vector;
0284 
0285   /**
0286    * @brief This member specifies if the ``entry`` parameter value.
0287    */
0288   rtems_interrupt_entry *entry;
0289 
0290   /**
0291    * @brief This member contains the return value of the
0292    *   rtems_interrupt_entry_remove() call.
0293    */
0294   rtems_status_code status;
0295 
0296   struct {
0297     /**
0298      * @brief This member defines the pre-condition indices for the next
0299      *   action.
0300      */
0301     size_t pci[ 9 ];
0302 
0303     /**
0304      * @brief This member defines the pre-condition states for the next action.
0305      */
0306     size_t pcs[ 9 ];
0307 
0308     /**
0309      * @brief If this member is true, then the test action loop is executed.
0310      */
0311     bool in_action_loop;
0312 
0313     /**
0314      * @brief This member contains the next transition map index.
0315      */
0316     size_t index;
0317 
0318     /**
0319      * @brief This member contains the current transition map entry.
0320      */
0321     RtemsIntrReqEntryRemove_Entry entry;
0322 
0323     /**
0324      * @brief If this member is true, then the current transition variant
0325      *   should be skipped.
0326      */
0327     bool skip;
0328   } Map;
0329 } RtemsIntrReqEntryRemove_Context;
0330 
0331 static RtemsIntrReqEntryRemove_Context
0332   RtemsIntrReqEntryRemove_Instance;
0333 
0334 static const char * const RtemsIntrReqEntryRemove_PreDesc_Vector[] = {
0335   "Valid",
0336   "Invalid",
0337   "NA"
0338 };
0339 
0340 static const char * const RtemsIntrReqEntryRemove_PreDesc_Entry[] = {
0341   "Obj",
0342   "Null",
0343   "NA"
0344 };
0345 
0346 static const char * const RtemsIntrReqEntryRemove_PreDesc_Routine[] = {
0347   "Valid",
0348   "Null",
0349   "NA"
0350 };
0351 
0352 static const char * const RtemsIntrReqEntryRemove_PreDesc_EntryObj[] = {
0353   "Installed",
0354   "Match",
0355   "NoMatch",
0356   "NA"
0357 };
0358 
0359 static const char * const RtemsIntrReqEntryRemove_PreDesc_Init[] = {
0360   "Yes",
0361   "No",
0362   "NA"
0363 };
0364 
0365 static const char * const RtemsIntrReqEntryRemove_PreDesc_ISR[] = {
0366   "Yes",
0367   "No",
0368   "NA"
0369 };
0370 
0371 static const char * const RtemsIntrReqEntryRemove_PreDesc_CanDisable[] = {
0372   "Yes",
0373   "Maybe",
0374   "No",
0375   "NA"
0376 };
0377 
0378 static const char * const RtemsIntrReqEntryRemove_PreDesc_First[] = {
0379   "Yes",
0380   "No",
0381   "NA"
0382 };
0383 
0384 static const char * const RtemsIntrReqEntryRemove_PreDesc_Last[] = {
0385   "Yes",
0386   "No",
0387   "NA"
0388 };
0389 
0390 static const char * const * const RtemsIntrReqEntryRemove_PreDesc[] = {
0391   RtemsIntrReqEntryRemove_PreDesc_Vector,
0392   RtemsIntrReqEntryRemove_PreDesc_Entry,
0393   RtemsIntrReqEntryRemove_PreDesc_Routine,
0394   RtemsIntrReqEntryRemove_PreDesc_EntryObj,
0395   RtemsIntrReqEntryRemove_PreDesc_Init,
0396   RtemsIntrReqEntryRemove_PreDesc_ISR,
0397   RtemsIntrReqEntryRemove_PreDesc_CanDisable,
0398   RtemsIntrReqEntryRemove_PreDesc_First,
0399   RtemsIntrReqEntryRemove_PreDesc_Last,
0400   NULL
0401 };
0402 
0403 typedef RtemsIntrReqEntryRemove_Context Context;
0404 
0405 static char entry_arg;
0406 
0407 static char other_arg;
0408 
0409 static char third_arg;
0410 
0411 static const char info[] = "Info";
0412 
0413 static void Install(
0414   Context                *ctx,
0415   rtems_interrupt_entry  *entry,
0416   rtems_interrupt_handler routine,
0417   void                   *arg
0418 )
0419 {
0420   rtems_status_code sc;
0421 
0422   rtems_interrupt_entry_initialize(
0423     entry,
0424     routine,
0425     arg,
0426     info
0427   );
0428 
0429   sc = rtems_interrupt_entry_install(
0430     ctx->test_vector,
0431     RTEMS_INTERRUPT_SHARED,
0432     entry
0433   );
0434   T_rsc_success( sc );
0435 }
0436 
0437 static void OtherRoutine( void *arg )
0438 {
0439   Context          *ctx;
0440   rtems_status_code sc;
0441 
0442   (void) arg;
0443   ctx = T_fixture_context();
0444   sc = rtems_interrupt_vector_disable( ctx->test_vector );
0445   T_rsc_success( sc );
0446 
0447   ctx->interrupt_occurred = true;
0448 }
0449 
0450 static void ThirdRoutine( void *arg )
0451 {
0452   T_eq_ptr( arg, &third_arg );
0453   OtherRoutine( NULL );
0454 }
0455 
0456 static void EntryRoutine( void *arg )
0457 {
0458   Context *ctx;
0459 
0460   ctx = T_fixture_context();
0461   ++ctx->entry_counter;
0462 
0463   T_eq_ptr( arg, &entry_arg );
0464   OtherRoutine( NULL );
0465 }
0466 
0467 static void Action( void *arg )
0468 {
0469   Context          *ctx;
0470   rtems_status_code sc;
0471 
0472   ctx = arg;
0473 
0474   sc = rtems_interrupt_vector_is_enabled(
0475     ctx->test_vector,
0476     &ctx->enabled_before
0477   );
0478   T_rsc_success( sc );
0479 
0480   bsp_interrupt_set_handler_unique(
0481     BSP_INTERRUPT_DISPATCH_TABLE_SIZE,
0482     ctx->initialized
0483   );
0484 
0485   ctx->status = rtems_interrupt_entry_remove( ctx->vector, ctx->entry );
0486 
0487   bsp_interrupt_set_handler_unique(
0488     BSP_INTERRUPT_DISPATCH_TABLE_SIZE,
0489     ctx->initialized_during_setup
0490   );
0491 
0492   sc = rtems_interrupt_vector_is_enabled(
0493     ctx->test_vector,
0494     &ctx->enabled_after
0495   );
0496   T_rsc_success( sc );
0497 }
0498 
0499 static void VisitInstalledNo(
0500   void                   *arg,
0501   const char             *entry_info,
0502   rtems_option            options,
0503   rtems_interrupt_handler handler_routine,
0504   void                   *handler_arg
0505 )
0506 {
0507   Context *ctx;
0508   uint32_t visited_entries;
0509 
0510   ctx = arg;
0511   visited_entries = ctx->visited_entries;
0512 
0513   T_eq_u32( options, RTEMS_INTERRUPT_SHARED );
0514   T_eq_ptr( entry_info, info );
0515 
0516   if ( visited_entries == 0 ) {
0517     T_eq_ptr( handler_routine, ctx->other_entry.handler );
0518     T_eq_ptr( handler_arg, ctx->other_entry.arg );
0519   } else if ( visited_entries == 1 ) {
0520     T_eq_ptr( handler_routine, ctx->third_entry.handler );
0521     T_eq_ptr( handler_arg, ctx->third_entry.arg );
0522   }
0523 
0524   ctx->visited_entries = visited_entries + 1;
0525 }
0526 
0527 static void VisitInstalledNop(
0528   void                   *arg,
0529   const char             *entry_info,
0530   rtems_option            options,
0531   rtems_interrupt_handler handler_routine,
0532   void                   *handler_arg
0533 )
0534 {
0535   Context *ctx;
0536   uint32_t visited_entries;
0537 
0538   ctx = arg;
0539   visited_entries = ctx->visited_entries;
0540 
0541   T_eq_u32( options, RTEMS_INTERRUPT_SHARED );
0542   T_eq_ptr( entry_info, info );
0543 
0544   if ( visited_entries == 0 ) {
0545     if ( ctx->installed && ctx->first ) {
0546       T_eq_ptr( handler_routine, ctx->entry_obj.handler );
0547       T_eq_ptr( handler_arg, ctx->entry_obj.arg );
0548     } else {
0549       T_eq_ptr( info, ctx->other_entry.info );
0550       T_eq_ptr( handler_routine, ctx->other_entry.handler );
0551       T_eq_ptr( handler_arg, ctx->other_entry.arg );
0552     }
0553   } else if ( visited_entries == 1 ) {
0554     if (
0555       ctx->installed && ( ( !ctx->first && ctx->last ) ||
0556         ( !ctx->first && !ctx->last ) )
0557     ) {
0558       T_eq_ptr( handler_routine, ctx->entry_obj.handler );
0559       T_eq_ptr( handler_arg, ctx->entry_obj.arg );
0560     } else {
0561       T_eq_ptr( handler_routine, ctx->other_entry.handler );
0562       T_eq_ptr( handler_arg, ctx->other_entry.arg );
0563     }
0564   } else if ( visited_entries == 2 ) {
0565     if ( ctx->installed && !ctx->first && ctx->last ) {
0566       T_eq_ptr( handler_routine, ctx->entry_obj.handler );
0567       T_eq_ptr( handler_arg, ctx->entry_obj.arg );
0568     } else {
0569       T_eq_ptr( handler_routine, ctx->third_entry.handler );
0570       T_eq_ptr( handler_arg, ctx->third_entry.arg );
0571     }
0572   }
0573 
0574   ctx->visited_entries = visited_entries + 1;
0575 }
0576 
0577 static void RtemsIntrReqEntryRemove_Pre_Vector_Prepare(
0578   RtemsIntrReqEntryRemove_Context   *ctx,
0579   RtemsIntrReqEntryRemove_Pre_Vector state
0580 )
0581 {
0582   switch ( state ) {
0583     case RtemsIntrReqEntryRemove_Pre_Vector_Valid: {
0584       /*
0585        * While the ``vector`` parameter is associated with an interrupt vector.
0586        */
0587       ctx->vector = ctx->test_vector;
0588       break;
0589     }
0590 
0591     case RtemsIntrReqEntryRemove_Pre_Vector_Invalid: {
0592       /*
0593        * While the ``vector`` parameter is not associated with an interrupt
0594        * vector.
0595        */
0596       ctx->vector = BSP_INTERRUPT_VECTOR_COUNT;
0597       break;
0598     }
0599 
0600     case RtemsIntrReqEntryRemove_Pre_Vector_NA:
0601       break;
0602   }
0603 }
0604 
0605 static void RtemsIntrReqEntryRemove_Pre_Entry_Prepare(
0606   RtemsIntrReqEntryRemove_Context  *ctx,
0607   RtemsIntrReqEntryRemove_Pre_Entry state
0608 )
0609 {
0610   switch ( state ) {
0611     case RtemsIntrReqEntryRemove_Pre_Entry_Obj: {
0612       /*
0613        * While the ``entry`` parameter references an object of type
0614        * rtems_interrupt_entry.
0615        */
0616       ctx->entry = &ctx->entry_obj;
0617       break;
0618     }
0619 
0620     case RtemsIntrReqEntryRemove_Pre_Entry_Null: {
0621       /*
0622        * While the ``entry`` parameter is equal to NULL.
0623        */
0624       ctx->entry = NULL;
0625       break;
0626     }
0627 
0628     case RtemsIntrReqEntryRemove_Pre_Entry_NA:
0629       break;
0630   }
0631 }
0632 
0633 static void RtemsIntrReqEntryRemove_Pre_Routine_Prepare(
0634   RtemsIntrReqEntryRemove_Context    *ctx,
0635   RtemsIntrReqEntryRemove_Pre_Routine state
0636 )
0637 {
0638   switch ( state ) {
0639     case RtemsIntrReqEntryRemove_Pre_Routine_Valid: {
0640       /*
0641        * While the handler routine of the entry referenced by the ``options``
0642        * parameter is valid.
0643        */
0644       rtems_interrupt_entry_initialize(
0645         &ctx->entry_obj,
0646         EntryRoutine,
0647         &entry_arg,
0648         info
0649       );
0650       break;
0651     }
0652 
0653     case RtemsIntrReqEntryRemove_Pre_Routine_Null: {
0654       /*
0655        * While the handler routine of the entry referenced by the ``options``
0656        * parameter is equal to NULL.
0657        */
0658       rtems_interrupt_entry_initialize(
0659         &ctx->entry_obj,
0660         NULL,
0661         &entry_arg,
0662         info
0663       );
0664       break;
0665     }
0666 
0667     case RtemsIntrReqEntryRemove_Pre_Routine_NA:
0668       break;
0669   }
0670 }
0671 
0672 static void RtemsIntrReqEntryRemove_Pre_EntryObj_Prepare(
0673   RtemsIntrReqEntryRemove_Context     *ctx,
0674   RtemsIntrReqEntryRemove_Pre_EntryObj state
0675 )
0676 {
0677   switch ( state ) {
0678     case RtemsIntrReqEntryRemove_Pre_EntryObj_Installed: {
0679       /*
0680        * While the entry referenced by the ``options`` parameter is installed
0681        * at the interrupt vector specified by the ``vector`` parameter.
0682        */
0683       ctx->installed = true;
0684       break;
0685     }
0686 
0687     case RtemsIntrReqEntryRemove_Pre_EntryObj_Match: {
0688       /*
0689        * While the entry referenced by the ``options`` parameter not installed
0690        * at the interrupt vector specified by the ``vector`` parameter, while
0691        * the entry referenced by the ``options`` has a handler routine and
0692        * argument pair which is equal to the handler routine and argument pair
0693        * of an entry installed at the interrupt vector specified by the
0694        * ``vector`` parameter.
0695        */
0696       ctx->installed = false;
0697       ctx->other_installed = true;
0698       ctx->match = true;
0699       break;
0700     }
0701 
0702     case RtemsIntrReqEntryRemove_Pre_EntryObj_NoMatch: {
0703       /*
0704        * While the entry referenced by the ``options`` parameter not installed
0705        * at the interrupt vector specified by the ``vector`` parameter, while
0706        * the entry referenced by the ``options`` has a handler routine and
0707        * argument pair which is not equal to the handler routine and argument
0708        * pairs of all entries installed at the interrupt vector specified by
0709        * the ``vector`` parameter.
0710        */
0711       ctx->installed = false;
0712       ctx->other_installed = true;
0713       ctx->match = false;
0714       break;
0715     }
0716 
0717     case RtemsIntrReqEntryRemove_Pre_EntryObj_NA:
0718       break;
0719   }
0720 }
0721 
0722 static void RtemsIntrReqEntryRemove_Pre_Init_Prepare(
0723   RtemsIntrReqEntryRemove_Context *ctx,
0724   RtemsIntrReqEntryRemove_Pre_Init state
0725 )
0726 {
0727   switch ( state ) {
0728     case RtemsIntrReqEntryRemove_Pre_Init_Yes: {
0729       /*
0730        * While the service is initialized.
0731        */
0732       ctx->initialized = true;
0733       break;
0734     }
0735 
0736     case RtemsIntrReqEntryRemove_Pre_Init_No: {
0737       /*
0738        * While the service is not initialized.
0739        */
0740       ctx->initialized = false;
0741       break;
0742     }
0743 
0744     case RtemsIntrReqEntryRemove_Pre_Init_NA:
0745       break;
0746   }
0747 }
0748 
0749 static void RtemsIntrReqEntryRemove_Pre_ISR_Prepare(
0750   RtemsIntrReqEntryRemove_Context *ctx,
0751   RtemsIntrReqEntryRemove_Pre_ISR  state
0752 )
0753 {
0754   switch ( state ) {
0755     case RtemsIntrReqEntryRemove_Pre_ISR_Yes: {
0756       /*
0757        * While rtems_interrupt_entry_remove() is called from within interrupt
0758        * context.
0759        */
0760       ctx->isr = true;
0761       break;
0762     }
0763 
0764     case RtemsIntrReqEntryRemove_Pre_ISR_No: {
0765       /*
0766        * While rtems_interrupt_entry_remove() is not called from within
0767        * interrupt context.
0768        */
0769       ctx->isr = false;
0770       break;
0771     }
0772 
0773     case RtemsIntrReqEntryRemove_Pre_ISR_NA:
0774       break;
0775   }
0776 }
0777 
0778 static void RtemsIntrReqEntryRemove_Pre_CanDisable_Prepare(
0779   RtemsIntrReqEntryRemove_Context       *ctx,
0780   RtemsIntrReqEntryRemove_Pre_CanDisable state
0781 )
0782 {
0783   switch ( state ) {
0784     case RtemsIntrReqEntryRemove_Pre_CanDisable_Yes: {
0785       /*
0786        * While the interrupt vector associated with the ``vector`` parameter
0787        * can be disabled.
0788        */
0789       /*
0790        * This pre-condition depends on the attributes of an interrupt vector.
0791        * For the validation test of rtems_interrupt_entry_remove() a testable
0792        * interrupt vector is determined by GetTestableInterruptVector().  The
0793        * implementation of rtems_interrupt_entry_remove() uses
0794        * rtems_interrupt_vector_disable() which is validated separately in detail.
0795        */
0796       break;
0797     }
0798 
0799     case RtemsIntrReqEntryRemove_Pre_CanDisable_Maybe: {
0800       /*
0801        * While the interrupt vector associated with the ``vector`` parameter
0802        * may be disabled.
0803        */
0804       /* See comment for ``Yes`` state */
0805       break;
0806     }
0807 
0808     case RtemsIntrReqEntryRemove_Pre_CanDisable_No: {
0809       /*
0810        * While the interrupt vector associated with the ``vector`` parameter
0811        * cannot be disabled.
0812        */
0813       /* See comment for ``Yes`` state */
0814       break;
0815     }
0816 
0817     case RtemsIntrReqEntryRemove_Pre_CanDisable_NA:
0818       break;
0819   }
0820 }
0821 
0822 static void RtemsIntrReqEntryRemove_Pre_First_Prepare(
0823   RtemsIntrReqEntryRemove_Context  *ctx,
0824   RtemsIntrReqEntryRemove_Pre_First state
0825 )
0826 {
0827   switch ( state ) {
0828     case RtemsIntrReqEntryRemove_Pre_First_Yes: {
0829       /*
0830        * While the entry referenced by the ``entry`` parameter is installed as
0831        * the first entry at the interrupt vector specified by the ``vector``
0832        * parameter.
0833        */
0834       ctx->first = true;
0835       break;
0836     }
0837 
0838     case RtemsIntrReqEntryRemove_Pre_First_No: {
0839       /*
0840        * While the entry referenced by the ``entry`` parameter is installed as
0841        * not the first entry at the interrupt vector specified by the
0842        * ``vector`` parameter.
0843        */
0844       ctx->first = false;
0845       break;
0846     }
0847 
0848     case RtemsIntrReqEntryRemove_Pre_First_NA:
0849       break;
0850   }
0851 }
0852 
0853 static void RtemsIntrReqEntryRemove_Pre_Last_Prepare(
0854   RtemsIntrReqEntryRemove_Context *ctx,
0855   RtemsIntrReqEntryRemove_Pre_Last state
0856 )
0857 {
0858   switch ( state ) {
0859     case RtemsIntrReqEntryRemove_Pre_Last_Yes: {
0860       /*
0861        * While the entry referenced by the ``entry`` parameter is installed as
0862        * the last entry at the interrupt vector specified by the ``vector``
0863        * parameter.
0864        */
0865       ctx->last = true;
0866       break;
0867     }
0868 
0869     case RtemsIntrReqEntryRemove_Pre_Last_No: {
0870       /*
0871        * While the entry referenced by the ``entry`` parameter is installed as
0872        * not the last entry at the interrupt vector specified by the ``vector``
0873        * parameter.
0874        */
0875       ctx->last = false;
0876       break;
0877     }
0878 
0879     case RtemsIntrReqEntryRemove_Pre_Last_NA:
0880       break;
0881   }
0882 }
0883 
0884 static void RtemsIntrReqEntryRemove_Post_Status_Check(
0885   RtemsIntrReqEntryRemove_Context    *ctx,
0886   RtemsIntrReqEntryRemove_Post_Status state
0887 )
0888 {
0889   switch ( state ) {
0890     case RtemsIntrReqEntryRemove_Post_Status_Ok: {
0891       /*
0892        * The return status of rtems_interrupt_entry_remove() shall be
0893        * RTEMS_SUCCESSFUL.
0894        */
0895       T_rsc_success( ctx->status );
0896       break;
0897     }
0898 
0899     case RtemsIntrReqEntryRemove_Post_Status_InvAddr: {
0900       /*
0901        * The return status of rtems_interrupt_entry_remove() shall be
0902        * RTEMS_INVALID_ADDRESS.
0903        */
0904       T_rsc( ctx->status, RTEMS_INVALID_ADDRESS );
0905       break;
0906     }
0907 
0908     case RtemsIntrReqEntryRemove_Post_Status_IncStat: {
0909       /*
0910        * The return status of rtems_interrupt_entry_remove() shall be
0911        * RTEMS_INCORRECT_STATE.
0912        */
0913       T_rsc( ctx->status, RTEMS_INCORRECT_STATE );
0914       break;
0915     }
0916 
0917     case RtemsIntrReqEntryRemove_Post_Status_InvId: {
0918       /*
0919        * The return status of rtems_interrupt_entry_remove() shall be
0920        * RTEMS_INVALID_ID.
0921        */
0922       T_rsc( ctx->status, RTEMS_INVALID_ID );
0923       break;
0924     }
0925 
0926     case RtemsIntrReqEntryRemove_Post_Status_CalledFromISR: {
0927       /*
0928        * The return status of rtems_interrupt_entry_remove() shall be
0929        * RTEMS_CALLED_FROM_ISR.
0930        */
0931       T_rsc( ctx->status, RTEMS_CALLED_FROM_ISR );
0932       break;
0933     }
0934 
0935     case RtemsIntrReqEntryRemove_Post_Status_Unsat: {
0936       /*
0937        * The return status of rtems_interrupt_entry_remove() shall be
0938        * RTEMS_UNSATISFIED.
0939        */
0940       T_rsc( ctx->status, RTEMS_UNSATISFIED );
0941       break;
0942     }
0943 
0944     case RtemsIntrReqEntryRemove_Post_Status_NA:
0945       break;
0946   }
0947 }
0948 
0949 static void RtemsIntrReqEntryRemove_Post_Disabled_Check(
0950   RtemsIntrReqEntryRemove_Context      *ctx,
0951   RtemsIntrReqEntryRemove_Post_Disabled state
0952 )
0953 {
0954   switch ( state ) {
0955     case RtemsIntrReqEntryRemove_Post_Disabled_Nop: {
0956       /*
0957        * The enabled status of the interrupt vector specified by ``vector``
0958        * shall not be modified by the rtems_interrupt_entry_remove() call.
0959        */
0960       if ( !ctx->interrupt_occurred ) {
0961         T_eq( ctx->enabled_before, ctx->enabled_after );
0962       }
0963       break;
0964     }
0965 
0966     case RtemsIntrReqEntryRemove_Post_Disabled_Yes: {
0967       /*
0968        * The interrupt vector specified by ``vector`` shall be disabled.
0969        */
0970       if ( ctx->attributes.can_disable ) {
0971         T_false( ctx->enabled_after );
0972       }
0973       break;
0974     }
0975 
0976     case RtemsIntrReqEntryRemove_Post_Disabled_Maybe: {
0977       /*
0978        * The interrupt vector specified by ``vector`` may be disabled.
0979        */
0980       /* The comment of pre-condition ``CanDisable`` for the ``Yes`` state. */
0981       if ( ctx->attributes.can_disable ) {
0982         T_false( ctx->enabled_after );
0983       }
0984       break;
0985     }
0986 
0987     case RtemsIntrReqEntryRemove_Post_Disabled_No: {
0988       /*
0989        * The interrupt vector specified by ``vector`` shall not be disabled.
0990        */
0991       /* The comment of pre-condition ``CanDisable`` for the ``Yes`` state. */
0992       if ( ctx->attributes.can_disable ) {
0993         T_false( ctx->enabled_after );
0994       }
0995       break;
0996     }
0997 
0998     case RtemsIntrReqEntryRemove_Post_Disabled_NA:
0999       break;
1000   }
1001 }
1002 
1003 static void RtemsIntrReqEntryRemove_Post_Installed_Check(
1004   RtemsIntrReqEntryRemove_Context       *ctx,
1005   RtemsIntrReqEntryRemove_Post_Installed state
1006 )
1007 {
1008   rtems_status_code sc;
1009   uint32_t          expected_entries;
1010 
1011   switch ( state ) {
1012     case RtemsIntrReqEntryRemove_Post_Installed_No: {
1013       /*
1014        * The entry referenced by ``entry`` shall not be installed at the
1015        * interrupt vector specified by ``vector``.
1016        */
1017       ctx->visited_entries = 0;
1018       sc = rtems_interrupt_handler_iterate(
1019         ctx->test_vector,
1020         VisitInstalledNo,
1021         ctx
1022       );
1023       T_rsc_success( sc );
1024 
1025       if ( ctx->other_installed && ctx->third_installed ) {
1026         expected_entries = 2;
1027       } else if ( ctx->other_installed ) {
1028         expected_entries = 1;
1029       } else {
1030         expected_entries = 0;
1031       }
1032 
1033       T_eq_u32( ctx->visited_entries, expected_entries );
1034 
1035       if ( expected_entries > 0 ) {
1036         ctx->entry_counter = 0;
1037         bsp_interrupt_handler_dispatch_unchecked( ctx->test_vector );
1038         T_eq_u32( ctx->entry_counter, 0 );
1039       } else {
1040         rtems_interrupt_entry *first;
1041 
1042         first = bsp_interrupt_dispatch_table[
1043           bsp_interrupt_dispatch_index( ctx->test_vector )
1044         ];
1045         T_null( first );
1046       }
1047       break;
1048     }
1049 
1050     case RtemsIntrReqEntryRemove_Post_Installed_Nop: {
1051       /*
1052        * The entries installed at the interrupt vector specified by ``vector``
1053        * shall not be modified by the rtems_interrupt_entry_remove() call.
1054        */
1055       ctx->visited_entries = 0;
1056       sc = rtems_interrupt_handler_iterate(
1057         ctx->test_vector,
1058         VisitInstalledNop,
1059         ctx
1060       );
1061       T_rsc_success( sc );
1062 
1063       if ( ctx->installed && ctx->other_installed && ctx->third_installed ) {
1064         expected_entries = 3;
1065       } else if ( ctx->installed && ctx->other_installed ) {
1066         expected_entries = 2;
1067       } else if ( ctx->installed || ctx->other_installed ) {
1068         expected_entries = 1;
1069       } else {
1070         expected_entries = 0;
1071       }
1072 
1073       T_eq_u32( ctx->visited_entries, expected_entries );
1074 
1075       if ( ctx->installed ) {
1076         ctx->entry_counter = 0;
1077         bsp_interrupt_handler_dispatch_unchecked( ctx->test_vector );
1078         T_eq_u32( ctx->entry_counter, 1 );
1079       }
1080       break;
1081     }
1082 
1083     case RtemsIntrReqEntryRemove_Post_Installed_NA:
1084       break;
1085   }
1086 }
1087 
1088 static void RtemsIntrReqEntryRemove_Setup(
1089   RtemsIntrReqEntryRemove_Context *ctx
1090 )
1091 {
1092   rtems_status_code sc;
1093 
1094   ctx->initialized_during_setup = bsp_interrupt_is_initialized();
1095   ctx->test_vector = GetTestableInterruptVector( NULL );
1096   ctx->test_vector_was_enabled = false;
1097   (void) rtems_interrupt_vector_is_enabled(
1098     ctx->test_vector,
1099     &ctx->test_vector_was_enabled
1100   );
1101   sc = rtems_interrupt_get_attributes( ctx->test_vector, &ctx->attributes );
1102   T_rsc_success( sc );
1103 }
1104 
1105 static void RtemsIntrReqEntryRemove_Setup_Wrap( void *arg )
1106 {
1107   RtemsIntrReqEntryRemove_Context *ctx;
1108 
1109   ctx = arg;
1110   ctx->Map.in_action_loop = false;
1111   RtemsIntrReqEntryRemove_Setup( ctx );
1112 }
1113 
1114 static void RtemsIntrReqEntryRemove_Teardown(
1115   RtemsIntrReqEntryRemove_Context *ctx
1116 )
1117 {
1118   if ( ctx->test_vector_was_enabled ) {
1119     (void) rtems_interrupt_vector_enable( ctx->test_vector );
1120   }
1121 }
1122 
1123 static void RtemsIntrReqEntryRemove_Teardown_Wrap( void *arg )
1124 {
1125   RtemsIntrReqEntryRemove_Context *ctx;
1126 
1127   ctx = arg;
1128   ctx->Map.in_action_loop = false;
1129   RtemsIntrReqEntryRemove_Teardown( ctx );
1130 }
1131 
1132 static void RtemsIntrReqEntryRemove_Prepare(
1133   RtemsIntrReqEntryRemove_Context *ctx
1134 )
1135 {
1136   ctx->interrupt_occurred = false;
1137   ctx->installed = false;
1138   ctx->other_installed = false;
1139   ctx->third_installed = false;
1140 }
1141 
1142 static void RtemsIntrReqEntryRemove_Action(
1143   RtemsIntrReqEntryRemove_Context *ctx
1144 )
1145 {
1146   if ( ctx->installed ) {
1147     ctx->entry = &ctx->entry_obj;
1148 
1149     if ( ctx->first && ctx->last ) {
1150       Install( ctx, &ctx->entry_obj, EntryRoutine, &entry_arg );
1151     } else if ( ctx->first ) {
1152       ctx->other_installed = true;
1153       Install( ctx, &ctx->entry_obj, EntryRoutine, &entry_arg );
1154       Install( ctx, &ctx->other_entry, OtherRoutine, &other_arg );
1155     } else if ( ctx->last ) {
1156       ctx->other_installed = true;
1157       Install( ctx, &ctx->other_entry, OtherRoutine, &other_arg );
1158       Install( ctx, &ctx->entry_obj, EntryRoutine, &entry_arg );
1159     } else {
1160       ctx->other_installed = true;
1161       ctx->third_installed = true;
1162       Install( ctx, &ctx->other_entry, OtherRoutine, &other_arg );
1163       Install( ctx, &ctx->entry_obj, EntryRoutine, &entry_arg );
1164       Install( ctx, &ctx->third_entry, ThirdRoutine, &third_arg );
1165     }
1166   } else if ( ctx->other_installed ) {
1167     ctx->entry = &ctx->entry_obj;
1168 
1169     if ( ctx->match ) {
1170       Install( ctx, &ctx->other_entry, EntryRoutine, &entry_arg );
1171     } else {
1172       Install( ctx, &ctx->other_entry, OtherRoutine, &other_arg );
1173     }
1174   }
1175 
1176   if ( ctx->isr ) {
1177     CallWithinISR( Action, ctx );
1178   } else {
1179     Action( ctx );
1180   }
1181 }
1182 
1183 static void RtemsIntrReqEntryRemove_Cleanup(
1184   RtemsIntrReqEntryRemove_Context *ctx
1185 )
1186 {
1187   rtems_status_code sc;
1188 
1189   if ( ctx->third_installed ) {
1190     sc = rtems_interrupt_entry_remove( ctx->test_vector, &ctx->third_entry );
1191     T_rsc_success( sc );
1192   }
1193 
1194   if ( ctx->other_installed ) {
1195     sc = rtems_interrupt_entry_remove( ctx->test_vector, &ctx->other_entry );
1196     T_rsc_success( sc );
1197   }
1198 
1199   if ( ctx->installed && ctx->status != RTEMS_SUCCESSFUL ) {
1200     sc = rtems_interrupt_entry_remove( ctx->test_vector, ctx->entry );
1201     T_rsc_success( sc );
1202   }
1203 }
1204 
1205 static const RtemsIntrReqEntryRemove_Entry
1206 RtemsIntrReqEntryRemove_Entries[] = {
1207   { 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, RtemsIntrReqEntryRemove_Post_Status_InvAddr,
1208     RtemsIntrReqEntryRemove_Post_Disabled_Nop,
1209     RtemsIntrReqEntryRemove_Post_Installed_NA },
1210   { 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, RtemsIntrReqEntryRemove_Post_Status_InvAddr,
1211     RtemsIntrReqEntryRemove_Post_Disabled_NA,
1212     RtemsIntrReqEntryRemove_Post_Installed_NA },
1213   { 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, RtemsIntrReqEntryRemove_Post_Status_IncStat,
1214     RtemsIntrReqEntryRemove_Post_Disabled_Nop,
1215     RtemsIntrReqEntryRemove_Post_Installed_NA },
1216   { 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, RtemsIntrReqEntryRemove_Post_Status_IncStat,
1217     RtemsIntrReqEntryRemove_Post_Disabled_NA,
1218     RtemsIntrReqEntryRemove_Post_Installed_NA },
1219   { 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, RtemsIntrReqEntryRemove_Post_Status_InvAddr,
1220     RtemsIntrReqEntryRemove_Post_Disabled_Nop,
1221     RtemsIntrReqEntryRemove_Post_Installed_NA },
1222   { 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, RtemsIntrReqEntryRemove_Post_Status_InvId,
1223     RtemsIntrReqEntryRemove_Post_Disabled_NA,
1224     RtemsIntrReqEntryRemove_Post_Installed_NA },
1225   { 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, RtemsIntrReqEntryRemove_Post_Status_InvAddr,
1226     RtemsIntrReqEntryRemove_Post_Disabled_NA,
1227     RtemsIntrReqEntryRemove_Post_Installed_NA },
1228   { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
1229     RtemsIntrReqEntryRemove_Post_Status_CalledFromISR,
1230     RtemsIntrReqEntryRemove_Post_Disabled_Nop,
1231     RtemsIntrReqEntryRemove_Post_Installed_NA },
1232   { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, RtemsIntrReqEntryRemove_Post_Status_Unsat,
1233     RtemsIntrReqEntryRemove_Post_Disabled_Nop,
1234     RtemsIntrReqEntryRemove_Post_Installed_NA },
1235   { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1236     RtemsIntrReqEntryRemove_Post_Status_CalledFromISR,
1237     RtemsIntrReqEntryRemove_Post_Disabled_Nop,
1238     RtemsIntrReqEntryRemove_Post_Installed_Nop },
1239   { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, RtemsIntrReqEntryRemove_Post_Status_Ok,
1240     RtemsIntrReqEntryRemove_Post_Disabled_Nop,
1241     RtemsIntrReqEntryRemove_Post_Installed_No },
1242   { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, RtemsIntrReqEntryRemove_Post_Status_Ok,
1243     RtemsIntrReqEntryRemove_Post_Disabled_Yes,
1244     RtemsIntrReqEntryRemove_Post_Installed_No },
1245   { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, RtemsIntrReqEntryRemove_Post_Status_Ok,
1246     RtemsIntrReqEntryRemove_Post_Disabled_Maybe,
1247     RtemsIntrReqEntryRemove_Post_Installed_No },
1248   { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, RtemsIntrReqEntryRemove_Post_Status_Ok,
1249     RtemsIntrReqEntryRemove_Post_Disabled_No,
1250     RtemsIntrReqEntryRemove_Post_Installed_No }
1251 };
1252 
1253 static const uint8_t
1254 RtemsIntrReqEntryRemove_Map[] = {
1255   9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 10, 10, 10, 12, 10, 10, 10, 13, 10,
1256   10, 10, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1257   2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 2,
1258   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 7, 7, 7,
1259   7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 2, 2, 2, 2, 2,
1260   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4,
1261   4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1262   2, 2, 2, 2, 2, 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1303 {
1304   RtemsIntrReqEntryRemove_Context *ctx;
1305 
1306   ctx = arg;
1307 
1308   if ( ctx->Map.in_action_loop ) {
1309     return T_get_scope(
1310       RtemsIntrReqEntryRemove_PreDesc,
1311       buf,
1312       n,
1313       ctx->Map.pcs
1314     );
1315   }
1316 
1317   return 0;
1318 }
1319 
1320 static T_fixture RtemsIntrReqEntryRemove_Fixture = {
1321   .setup = RtemsIntrReqEntryRemove_Setup_Wrap,
1322   .stop = NULL,
1323   .teardown = RtemsIntrReqEntryRemove_Teardown_Wrap,
1324   .scope = RtemsIntrReqEntryRemove_Scope,
1325   .initial_context = &RtemsIntrReqEntryRemove_Instance
1326 };
1327 
1328 static inline RtemsIntrReqEntryRemove_Entry RtemsIntrReqEntryRemove_PopEntry(
1329   RtemsIntrReqEntryRemove_Context *ctx
1330 )
1331 {
1332   size_t index;
1333 
1334   index = ctx->Map.index;
1335   ctx->Map.index = index + 1;
1336   return RtemsIntrReqEntryRemove_Entries[
1337     RtemsIntrReqEntryRemove_Map[ index ]
1338   ];
1339 }
1340 
1341 static void RtemsIntrReqEntryRemove_SetPreConditionStates(
1342   RtemsIntrReqEntryRemove_Context *ctx
1343 )
1344 {
1345   ctx->Map.pcs[ 0 ] = ctx->Map.pci[ 0 ];
1346   ctx->Map.pcs[ 1 ] = ctx->Map.pci[ 1 ];
1347 
1348   if ( ctx->Map.entry.Pre_Routine_NA ) {
1349     ctx->Map.pcs[ 2 ] = RtemsIntrReqEntryRemove_Pre_Routine_NA;
1350   } else {
1351     ctx->Map.pcs[ 2 ] = ctx->Map.pci[ 2 ];
1352   }
1353 
1354   if ( ctx->Map.entry.Pre_EntryObj_NA ) {
1355     ctx->Map.pcs[ 3 ] = RtemsIntrReqEntryRemove_Pre_EntryObj_NA;
1356   } else {
1357     ctx->Map.pcs[ 3 ] = ctx->Map.pci[ 3 ];
1358   }
1359 
1360   ctx->Map.pcs[ 4 ] = ctx->Map.pci[ 4 ];
1361   ctx->Map.pcs[ 5 ] = ctx->Map.pci[ 5 ];
1362 
1363   if ( ctx->Map.entry.Pre_CanDisable_NA ) {
1364     ctx->Map.pcs[ 6 ] = RtemsIntrReqEntryRemove_Pre_CanDisable_NA;
1365   } else {
1366     ctx->Map.pcs[ 6 ] = ctx->Map.pci[ 6 ];
1367   }
1368 
1369   if ( ctx->Map.entry.Pre_First_NA ) {
1370     ctx->Map.pcs[ 7 ] = RtemsIntrReqEntryRemove_Pre_First_NA;
1371   } else {
1372     ctx->Map.pcs[ 7 ] = ctx->Map.pci[ 7 ];
1373   }
1374 
1375   if ( ctx->Map.entry.Pre_Last_NA ) {
1376     ctx->Map.pcs[ 8 ] = RtemsIntrReqEntryRemove_Pre_Last_NA;
1377   } else {
1378     ctx->Map.pcs[ 8 ] = ctx->Map.pci[ 8 ];
1379   }
1380 }
1381 
1382 static void RtemsIntrReqEntryRemove_TestVariant(
1383   RtemsIntrReqEntryRemove_Context *ctx
1384 )
1385 {
1386   RtemsIntrReqEntryRemove_Pre_Vector_Prepare( ctx, ctx->Map.pcs[ 0 ] );
1387   RtemsIntrReqEntryRemove_Pre_Entry_Prepare( ctx, ctx->Map.pcs[ 1 ] );
1388   RtemsIntrReqEntryRemove_Pre_Routine_Prepare( ctx, ctx->Map.pcs[ 2 ] );
1389   RtemsIntrReqEntryRemove_Pre_EntryObj_Prepare( ctx, ctx->Map.pcs[ 3 ] );
1390   RtemsIntrReqEntryRemove_Pre_Init_Prepare( ctx, ctx->Map.pcs[ 4 ] );
1391   RtemsIntrReqEntryRemove_Pre_ISR_Prepare( ctx, ctx->Map.pcs[ 5 ] );
1392   RtemsIntrReqEntryRemove_Pre_CanDisable_Prepare( ctx, ctx->Map.pcs[ 6 ] );
1393   RtemsIntrReqEntryRemove_Pre_First_Prepare( ctx, ctx->Map.pcs[ 7 ] );
1394   RtemsIntrReqEntryRemove_Pre_Last_Prepare( ctx, ctx->Map.pcs[ 8 ] );
1395   RtemsIntrReqEntryRemove_Action( ctx );
1396   RtemsIntrReqEntryRemove_Post_Status_Check( ctx, ctx->Map.entry.Post_Status );
1397   RtemsIntrReqEntryRemove_Post_Disabled_Check(
1398     ctx,
1399     ctx->Map.entry.Post_Disabled
1400   );
1401   RtemsIntrReqEntryRemove_Post_Installed_Check(
1402     ctx,
1403     ctx->Map.entry.Post_Installed
1404   );
1405 }
1406 
1407 /**
1408  * @fn void T_case_body_RtemsIntrReqEntryRemove( void )
1409  */
1410 T_TEST_CASE_FIXTURE(
1411   RtemsIntrReqEntryRemove,
1412   &RtemsIntrReqEntryRemove_Fixture
1413 )
1414 {
1415   RtemsIntrReqEntryRemove_Context *ctx;
1416 
1417   ctx = T_fixture_context();
1418   ctx->Map.in_action_loop = true;
1419   ctx->Map.index = 0;
1420 
1421   for (
1422     ctx->Map.pci[ 0 ] = RtemsIntrReqEntryRemove_Pre_Vector_Valid;
1423     ctx->Map.pci[ 0 ] < RtemsIntrReqEntryRemove_Pre_Vector_NA;
1424     ++ctx->Map.pci[ 0 ]
1425   ) {
1426     for (
1427       ctx->Map.pci[ 1 ] = RtemsIntrReqEntryRemove_Pre_Entry_Obj;
1428       ctx->Map.pci[ 1 ] < RtemsIntrReqEntryRemove_Pre_Entry_NA;
1429       ++ctx->Map.pci[ 1 ]
1430     ) {
1431       for (
1432         ctx->Map.pci[ 2 ] = RtemsIntrReqEntryRemove_Pre_Routine_Valid;
1433         ctx->Map.pci[ 2 ] < RtemsIntrReqEntryRemove_Pre_Routine_NA;
1434         ++ctx->Map.pci[ 2 ]
1435       ) {
1436         for (
1437           ctx->Map.pci[ 3 ] = RtemsIntrReqEntryRemove_Pre_EntryObj_Installed;
1438           ctx->Map.pci[ 3 ] < RtemsIntrReqEntryRemove_Pre_EntryObj_NA;
1439           ++ctx->Map.pci[ 3 ]
1440         ) {
1441           for (
1442             ctx->Map.pci[ 4 ] = RtemsIntrReqEntryRemove_Pre_Init_Yes;
1443             ctx->Map.pci[ 4 ] < RtemsIntrReqEntryRemove_Pre_Init_NA;
1444             ++ctx->Map.pci[ 4 ]
1445           ) {
1446             for (
1447               ctx->Map.pci[ 5 ] = RtemsIntrReqEntryRemove_Pre_ISR_Yes;
1448               ctx->Map.pci[ 5 ] < RtemsIntrReqEntryRemove_Pre_ISR_NA;
1449               ++ctx->Map.pci[ 5 ]
1450             ) {
1451               for (
1452                 ctx->Map.pci[ 6 ] = RtemsIntrReqEntryRemove_Pre_CanDisable_Yes;
1453                 ctx->Map.pci[ 6 ] < RtemsIntrReqEntryRemove_Pre_CanDisable_NA;
1454                 ++ctx->Map.pci[ 6 ]
1455               ) {
1456                 for (
1457                   ctx->Map.pci[ 7 ] = RtemsIntrReqEntryRemove_Pre_First_Yes;
1458                   ctx->Map.pci[ 7 ] < RtemsIntrReqEntryRemove_Pre_First_NA;
1459                   ++ctx->Map.pci[ 7 ]
1460                 ) {
1461                   for (
1462                     ctx->Map.pci[ 8 ] = RtemsIntrReqEntryRemove_Pre_Last_Yes;
1463                     ctx->Map.pci[ 8 ] < RtemsIntrReqEntryRemove_Pre_Last_NA;
1464                     ++ctx->Map.pci[ 8 ]
1465                   ) {
1466                     ctx->Map.entry = RtemsIntrReqEntryRemove_PopEntry( ctx );
1467                     RtemsIntrReqEntryRemove_SetPreConditionStates( ctx );
1468                     RtemsIntrReqEntryRemove_Prepare( ctx );
1469                     RtemsIntrReqEntryRemove_TestVariant( ctx );
1470                     RtemsIntrReqEntryRemove_Cleanup( ctx );
1471                   }
1472                 }
1473               }
1474             }
1475           }
1476         }
1477       }
1478     }
1479   }
1480 }
1481 
1482 /** @} */