summaryrefslogblamecommitdiffstats
path: root/testsuites/validation/tc-intr-entry-install.c
blob: 20d06df997e5a9ff24d43c7e55a2b90fa3302c95 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364



















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                 
/* SPDX-License-Identifier: BSD-2-Clause */

/**
 * @file
 *
 * @ingroup RTEMSTestCaseRtemsIntrReqEntryInstall
 */

/*
 * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * This file is part of the RTEMS quality process and was automatically
 * generated.  If you find something that needs to be fixed or
 * worded better please post a report or patch to an RTEMS mailing list
 * or raise a bug report:
 *
 * https://www.rtems.org/bugs.html
 *
 * For information on updating and regenerating please refer to the How-To
 * section in the Software Requirements Engineering chapter of the
 * RTEMS Software Engineering manual.  The manual is provided as a part of
 * a release.  For development sources please refer to the online
 * documentation at:
 *
 * https://docs.rtems.org
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <bsp/irq-generic.h>
#include <rtems/irq-extension.h>

#include "tx-support.h"

#include <rtems/test.h>

/**
 * @defgroup RTEMSTestCaseRtemsIntrReqEntryInstall \
 *   spec:/rtems/intr/req/entry-install
 *
 * @ingroup RTEMSTestSuiteTestsuitesValidation0
 *
 * @{
 */

typedef enum {
  RtemsIntrReqEntryInstall_Pre_Vector_Valid,
  RtemsIntrReqEntryInstall_Pre_Vector_Invalid,
  RtemsIntrReqEntryInstall_Pre_Vector_NA
} RtemsIntrReqEntryInstall_Pre_Vector;

typedef enum {
  RtemsIntrReqEntryInstall_Pre_Options_Unique,
  RtemsIntrReqEntryInstall_Pre_Options_Shared,
  RtemsIntrReqEntryInstall_Pre_Options_Replace,
  RtemsIntrReqEntryInstall_Pre_Options_NA
} RtemsIntrReqEntryInstall_Pre_Options;

typedef enum {
  RtemsIntrReqEntryInstall_Pre_Entry_Obj,
  RtemsIntrReqEntryInstall_Pre_Entry_Null,
  RtemsIntrReqEntryInstall_Pre_Entry_NA
} RtemsIntrReqEntryInstall_Pre_Entry;

typedef enum {
  RtemsIntrReqEntryInstall_Pre_Routine_Valid,
  RtemsIntrReqEntryInstall_Pre_Routine_Null,
  RtemsIntrReqEntryInstall_Pre_Routine_NA
} RtemsIntrReqEntryInstall_Pre_Routine;

typedef enum {
  RtemsIntrReqEntryInstall_Pre_Init_Yes,
  RtemsIntrReqEntryInstall_Pre_Init_No,
  RtemsIntrReqEntryInstall_Pre_Init_NA
} RtemsIntrReqEntryInstall_Pre_Init;

typedef enum {
  RtemsIntrReqEntryInstall_Pre_ISR_Yes,
  RtemsIntrReqEntryInstall_Pre_ISR_No,
  RtemsIntrReqEntryInstall_Pre_ISR_NA
} RtemsIntrReqEntryInstall_Pre_ISR;

typedef enum {
  RtemsIntrReqEntryInstall_Pre_CanEnable_Yes,
  RtemsIntrReqEntryInstall_Pre_CanEnable_Maybe,
  RtemsIntrReqEntryInstall_Pre_CanEnable_No,
  RtemsIntrReqEntryInstall_Pre_CanEnable_NA
} RtemsIntrReqEntryInstall_Pre_CanEnable;

typedef enum {
  RtemsIntrReqEntryInstall_Pre_Installed_None,
  RtemsIntrReqEntryInstall_Pre_Installed_Unique,
  RtemsIntrReqEntryInstall_Pre_Installed_Other,
  RtemsIntrReqEntryInstall_Pre_Installed_EqRoutine,
  RtemsIntrReqEntryInstall_Pre_Installed_EqArg,
  RtemsIntrReqEntryInstall_Pre_Installed_Match,
  RtemsIntrReqEntryInstall_Pre_Installed_NA
} RtemsIntrReqEntryInstall_Pre_Installed;

typedef enum {
  RtemsIntrReqEntryInstall_Post_Status_Ok,
  RtemsIntrReqEntryInstall_Post_Status_InvAddr,
  RtemsIntrReqEntryInstall_Post_Status_IncStat,
  RtemsIntrReqEntryInstall_Post_Status_InvId,
  RtemsIntrReqEntryInstall_Post_Status_InvNum,
  RtemsIntrReqEntryInstall_Post_Status_CalledFromISR,
  RtemsIntrReqEntryInstall_Post_Status_InUse,
  RtemsIntrReqEntryInstall_Post_Status_TooMany,
  RtemsIntrReqEntryInstall_Post_Status_NA
} RtemsIntrReqEntryInstall_Post_Status;

typedef enum {
  RtemsIntrReqEntryInstall_Post_Enable_Nop,
  RtemsIntrReqEntryInstall_Post_Enable_Yes,
  RtemsIntrReqEntryInstall_Post_Enable_Maybe,
  RtemsIntrReqEntryInstall_Post_Enable_No,
  RtemsIntrReqEntryInstall_Post_Enable_NA
} RtemsIntrReqEntryInstall_Post_Enable;

typedef enum {
  RtemsIntrReqEntryInstall_Post_Installed_No,
  RtemsIntrReqEntryInstall_Post_Installed_Last,
  RtemsIntrReqEntryInstall_Post_Installed_NA
} RtemsIntrReqEntryInstall_Post_Installed;

/**
 * @brief Test context for spec:/rtems/intr/req/entry-install test case.
 */
typedef struct {
  /**
   * @brief If this member is true, then the service was initialized during
   *   setup.
   */
  bool initialized_during_setup;

  /**
   * @brief If this member is true, then an interrupt occurred.
   */
  bool interrupt_occurred;

  /**
   * @brief This member provides the vector number of a testable interrupt
   *   vector.
   */
  rtems_vector_number test_vector;

  /**
   * @brief This member provides the attributes of the testable interrupt
   *   vector.
   */
  rtems_interrupt_attributes attributes;

  /**
   * @brief If this member is true, then the service shall be initialized.
   */
  bool initialized;

  /**
   * @brief If this member is true, then rtems_interrupt_entry_install() shall
   *   be called from within interrupt context.
   */
  bool isr;

  /**
   * @brief This member contains the enabled status before the
   *   rtems_interrupt_entry_install() call.
   */
  bool enabled_before;

  /**
   * @brief This member contains the enabled status after the
   *   rtems_interrupt_entry_install() call.
   */
  bool enabled_after;

  /**
   * @brief This member provides the count of visited entries.
   */
  uint32_t visited_entries;

  /**
   * @brief This member provides another rtems_interrupt_entry object.
   */
  rtems_interrupt_entry other_entry;

  /**
   * @brief If this member is true, then another entry was installed.
   */
  bool other_installed;

  /**
   * @brief This member provides a third rtems_interrupt_entry object.
   */
  rtems_interrupt_entry third_entry;

  /**
   * @brief If this member is true, then the third entry was installed.
   */
  bool third_installed;

  /**
   * @brief This member provides the options used to install the other
   *   rtems_interrupt_entry object.
   */
  rtems_option other_options;

  /**
   * @brief This member provides the rtems_interrupt_entry object.
   */
  rtems_interrupt_entry entry_obj;

  /**
   * @brief This member specifies if the ``vector`` parameter value.
   */
  rtems_vector_number vector;

  /**
   * @brief This member specifies if the ``options`` parameter value.
   */
  rtems_option options;

  /**
   * @brief This member specifies if the ``entry`` parameter value.
   */
  rtems_interrupt_entry *entry;;

  /**
   * @brief This member contains the return value of the
   *   rtems_interrupt_entry_install() call.
   */
  rtems_status_code status;

  /**
   * @brief This member defines the pre-condition states for the next action.
   */
  size_t pcs[ 8 ];

  /**
   * @brief This member indicates if the test action loop is currently
   *   executed.
   */
  bool in_action_loop;
} RtemsIntrReqEntryInstall_Context;

static RtemsIntrReqEntryInstall_Context
  RtemsIntrReqEntryInstall_Instance;

static const char * const RtemsIntrReqEntryInstall_PreDesc_Vector[] = {
  "Valid",
  "Invalid",
  "NA"
};

static const char * const RtemsIntrReqEntryInstall_PreDesc_Options[] = {
  "Unique",
  "Shared",
  "Replace",
  "NA"
};

static const char * const RtemsIntrReqEntryInstall_PreDesc_Entry[] = {
  "Obj",
  "Null",
  "NA"
};

static const char * const RtemsIntrReqEntryInstall_PreDesc_Routine[] = {
  "Valid",
  "Null",
  "NA"
};

static const char * const RtemsIntrReqEntryInstall_PreDesc_Init[] = {
  "Yes",
  "No",
  "NA"
};

static const char * const RtemsIntrReqEntryInstall_PreDesc_ISR[] = {
  "Yes",
  "No",
  "NA"
};

static const char * const RtemsIntrReqEntryInstall_PreDesc_CanEnable[] = {
  "Yes",
  "Maybe",
  "No",
  "NA"
};

static const char * const RtemsIntrReqEntryInstall_PreDesc_Installed[] = {
  "None",
  "Unique",
  "Other",
  "EqRoutine",
  "EqArg",
  "Match",
  "NA"
};

static const char * const * const RtemsIntrReqEntryInstall_PreDesc[] = {
  RtemsIntrReqEntryInstall_PreDesc_Vector,
  RtemsIntrReqEntryInstall_PreDesc_Options,
  RtemsIntrReqEntryInstall_PreDesc_Entry,
  RtemsIntrReqEntryInstall_PreDesc_Routine,
  RtemsIntrReqEntryInstall_PreDesc_Init,
  RtemsIntrReqEntryInstall_PreDesc_ISR,
  RtemsIntrReqEntryInstall_PreDesc_CanEnable,
  RtemsIntrReqEntryInstall_PreDesc_Installed,
  NULL
};

typedef RtemsIntrReqEntryInstall_Context Context;

static char entry_arg;

static char other_arg;

static char third_arg;

static const char entry_info[] = "Entry";

static const char other_info[] = "Other";

static const char third_info[] = "Third";

static void Install(
  Context                *ctx,
  rtems_option            options,
  rtems_interrupt_handler routine,
  void                   *arg
)
{
  rtems_status_code sc;

  ctx->other_options = options;
  rtems_interrupt_entry_initialize(
    &ctx->other_entry,
    routine,
    arg,
    other_info
  );

  sc = rtems_interrupt_entry_install(
    ctx->test_vector,
    options,
    &ctx->other_entry
  );
  T_rsc_success( sc );

  ctx->other_installed = true;
}

static void OtherRoutine( void *arg )
{
  Context          *ctx;
  rtems_status_code sc;

  (void) arg;
  ctx = T_fixture_context();
  sc = rtems_interrupt_vector_disable( ctx->test_vector );
  T_rsc_success( sc );

  ctx->interrupt_occurred = true;
}

static void EntryRoutine( void *arg )
{
  T_eq_ptr( arg, &entry_arg );
  OtherRoutine( NULL );
}

static void ThirdRoutine( void *arg )
{
  T_eq_ptr( arg, &third_arg );
  OtherRoutine( NULL );
}

static void InstallThird( Context *ctx )
{
  rtems_status_code sc;

  rtems_interrupt_entry_initialize(
    &ctx->third_entry,
    ThirdRoutine,
    &third_arg,
    third_info
  );

  sc = rtems_interrupt_entry_install(
    ctx->test_vector,
    RTEMS_INTERRUPT_SHARED,
    &ctx->third_entry
  );
  T_rsc_success( sc );

  ctx->third_installed = true;
}

static void Action( void *arg )
{
  Context          *ctx;
  rtems_status_code sc;

  ctx = arg;

  sc = rtems_interrupt_vector_is_enabled(
    ctx->test_vector,
    &ctx->enabled_before
  );
  T_rsc_success( sc );

  bsp_interrupt_set_handler_unique(
    BSP_INTERRUPT_HANDLER_TABLE_SIZE,
    ctx->initialized
  );

  ctx->status = rtems_interrupt_entry_install(
    ctx->vector,
    ctx->options,
    ctx->entry
  );

  bsp_interrupt_set_handler_unique(
    BSP_INTERRUPT_HANDLER_TABLE_SIZE,
    ctx->initialized_during_setup
  );

  sc = rtems_interrupt_vector_is_enabled(
    ctx->test_vector,
    &ctx->enabled_after
  );
  T_rsc_success( sc );
}

static void VisitInstalled(
  void                   *arg,
  const char             *info,
  rtems_option            options,
  rtems_interrupt_handler handler_routine,
  void                   *handler_arg
)
{
  Context *ctx;
  uint32_t visited_entries;

  ctx = arg;
  visited_entries = ctx->visited_entries;

  if ( visited_entries == 0 && ctx->other_installed ) {
    T_eq_ptr( info, other_info );
    T_eq_u32( options, ctx->other_options );
    T_eq_ptr( handler_routine, ctx->other_entry.handler );
    T_eq_ptr( handler_arg, ctx->other_entry.arg );
  } else if ( visited_entries == 1 && ctx->third_installed ) {
    T_eq_ptr( info, third_info );
    T_eq_u32( options, RTEMS_INTERRUPT_SHARED );
    T_eq_ptr( handler_routine, ThirdRoutine );
    T_eq_ptr( handler_arg, &third_arg );
  } else {
    T_eq_ptr( info, entry_info );
    T_eq_u32( options, ctx->options );
    T_eq_ptr( handler_routine, ctx->entry_obj.handler );
    T_eq_ptr( handler_arg, ctx->entry_obj.arg );
  }

  ctx->visited_entries = visited_entries + 1;
}

static void RtemsIntrReqEntryInstall_Pre_Vector_Prepare(
  RtemsIntrReqEntryInstall_Context   *ctx,
  RtemsIntrReqEntryInstall_Pre_Vector state
)
{
  switch ( state ) {
    case RtemsIntrReqEntryInstall_Pre_Vector_Valid: {
      /*
       * While the ``vector`` parameter is associated with an interrupt vector.
       */
      ctx->vector = ctx->test_vector;
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Vector_Invalid: {
      /*
       * While the ``vector`` parameter is not associated with an interrupt
       * vector.
       */
      ctx->vector = BSP_INTERRUPT_VECTOR_COUNT;
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Vector_NA:
      break;
  }
}

static void RtemsIntrReqEntryInstall_Pre_Options_Prepare(
  RtemsIntrReqEntryInstall_Context    *ctx,
  RtemsIntrReqEntryInstall_Pre_Options state
)
{
  switch ( state ) {
    case RtemsIntrReqEntryInstall_Pre_Options_Unique: {
      /*
       * While the ``options`` indicates that an unique entry shall be
       * installed.
       */
      ctx->options = RTEMS_INTERRUPT_UNIQUE;
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Options_Shared: {
      /*
       * While the ``options`` indicates that a shared entry shall be
       * installed.
       */
      ctx->options = RTEMS_INTERRUPT_SHARED;
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Options_Replace: {
      /*
       * While the ``options`` indicates that the entry handler routine shall
       * be replaced.
       */
      ctx->options = RTEMS_INTERRUPT_REPLACE;
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Options_NA:
      break;
  }
}

static void RtemsIntrReqEntryInstall_Pre_Entry_Prepare(
  RtemsIntrReqEntryInstall_Context  *ctx,
  RtemsIntrReqEntryInstall_Pre_Entry state
)
{
  switch ( state ) {
    case RtemsIntrReqEntryInstall_Pre_Entry_Obj: {
      /*
       * While the ``entry`` parameter references an object of type
       * rtems_interrupt_entry.
       */
      ctx->entry = &ctx->entry_obj;
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Entry_Null: {
      /*
       * While the ``entry`` parameter is equal to NULL.
       */
      ctx->entry = NULL;
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Entry_NA:
      break;
  }
}

static void RtemsIntrReqEntryInstall_Pre_Routine_Prepare(
  RtemsIntrReqEntryInstall_Context    *ctx,
  RtemsIntrReqEntryInstall_Pre_Routine state
)
{
  switch ( state ) {
    case RtemsIntrReqEntryInstall_Pre_Routine_Valid: {
      /*
       * While the handler routine of the object referenced by the ``entry``
       * parameter is valid.
       */
      rtems_interrupt_entry_initialize(
        &ctx->entry_obj,
        EntryRoutine,
        &entry_arg,
        entry_info
      );
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Routine_Null: {
      /*
       * While the handler routine of the object referenced by the ``entry``
       * parameter is equal to NULL.
       */
      rtems_interrupt_entry_initialize(
        &ctx->entry_obj,
        NULL,
        &entry_arg,
        entry_info
      );
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Routine_NA:
      break;
  }
}

static void RtemsIntrReqEntryInstall_Pre_Init_Prepare(
  RtemsIntrReqEntryInstall_Context *ctx,
  RtemsIntrReqEntryInstall_Pre_Init state
)
{
  switch ( state ) {
    case RtemsIntrReqEntryInstall_Pre_Init_Yes: {
      /*
       * While the service is initialized.
       */
      ctx->initialized = true;
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Init_No: {
      /*
       * While the service is not initialized.
       */
      ctx->initialized = false;
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Init_NA:
      break;
  }
}

static void RtemsIntrReqEntryInstall_Pre_ISR_Prepare(
  RtemsIntrReqEntryInstall_Context *ctx,
  RtemsIntrReqEntryInstall_Pre_ISR  state
)
{
  switch ( state ) {
    case RtemsIntrReqEntryInstall_Pre_ISR_Yes: {
      /*
       * While rtems_interrupt_entry_install() is called from within interrupt
       * context.
       */
      ctx->isr = true;
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_ISR_No: {
      /*
       * While rtems_interrupt_entry_install() is not called from within
       * interrupt context.
       */
      ctx->isr = false;
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_ISR_NA:
      break;
  }
}

static void RtemsIntrReqEntryInstall_Pre_CanEnable_Prepare(
  RtemsIntrReqEntryInstall_Context      *ctx,
  RtemsIntrReqEntryInstall_Pre_CanEnable state
)
{
  switch ( state ) {
    case RtemsIntrReqEntryInstall_Pre_CanEnable_Yes: {
      /*
       * While the interrupt vector associated with the ``vector`` parameter
       * can be enabled.
       */
      /*
       * This pre-condition depends on the attributes of an interrupt vector.
       * For the validation test of rtems_interrupt_entry_install() a testable
       * interrupt vector is determined by GetTestableInterruptVector().  The
       * implementation of rtems_interrupt_entry_install() uses
       * rtems_interrupt_vector_enable() which is validated separately in detail.
       */
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_CanEnable_Maybe: {
      /*
       * While the interrupt vector associated with the ``vector`` parameter
       * may be enabled.
       */
      /* See comment for ``Yes`` state */
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_CanEnable_No: {
      /*
       * While the interrupt vector associated with the ``vector`` parameter
       * cannot be enabled.
       */
      /* See comment for ``Yes`` state */
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_CanEnable_NA:
      break;
  }
}

static void RtemsIntrReqEntryInstall_Pre_Installed_Prepare(
  RtemsIntrReqEntryInstall_Context      *ctx,
  RtemsIntrReqEntryInstall_Pre_Installed state
)
{
  switch ( state ) {
    case RtemsIntrReqEntryInstall_Pre_Installed_None: {
      /*
       * While the no entry is installed at the interrupt vector specified by
       * the ``vector`` parameter.
       */
      /* Nothing to do */
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Installed_Unique: {
      /*
       * While a unique entry is installed at the interrupt vector specified by
       * the ``vector`` parameter.
       */
      Install( ctx, RTEMS_INTERRUPT_UNIQUE, EntryRoutine, &entry_arg );
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Installed_Other: {
      /*
       * While at least one non-unique entry is installed at the interrupt
       * vector specified by the ``vector`` parameter, while all entries
       * installed at the interrupt vector specified by the ``vector``
       * parameter have a handler routine which is not equal to the handler
       * routine of the object referenced by the ``entry`` parameter, while all
       * entries installed at the interrupt vector specified by the ``vector``
       * parameter have a handler argument which is not equal to the handler
       * argument of the object referenced by the ``entry`` parameter.
       */
      Install( ctx, RTEMS_INTERRUPT_SHARED, OtherRoutine, &other_arg );
      InstallThird( ctx );
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Installed_EqRoutine: {
      /*
       * While at least one non-unique entry is installed at the interrupt
       * vector specified by the ``vector`` parameter, while at least one entry
       * installed at the interrupt vector specified by the ``vector``
       * parameter has a handler routine which is equal to the handler routine
       * of the object referenced by the ``entry`` parameter, while all entries
       * installed at the interrupt vector specified by the ``vector``
       * parameter have a handler argument which is not equal to the handler
       * argument of the object referenced by the ``entry`` parameter.
       */
      Install( ctx, RTEMS_INTERRUPT_SHARED, EntryRoutine, &other_arg );
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Installed_EqArg: {
      /*
       * While at least one non-unique entry is installed at the interrupt
       * vector specified by the ``vector`` parameter, while all entries
       * installed at the interrupt vector specified by the ``vector``
       * parameter have a handler routine which is not equal to the handler
       * routine of the object referenced by the ``entry`` parameter, while at
       * least one entry installed at the interrupt vector specified by the
       * ``vector`` parameter has a handler argument which is equal to the
       * handler argument of the object referenced by the ``entry`` parameter.
       */
      Install( ctx, RTEMS_INTERRUPT_SHARED, OtherRoutine, &other_arg );
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Installed_Match: {
      /*
       * While at least one non-unique entry with a handler routine which is
       * equal to the handler routine of the object referenced by the ``entry``
       * parameter and with a handler argument which is equal to the handler
       * argument of the object referenced by the ``entry`` parameter is
       * installed at the interrupt vector specified by the ``vector``
       * parameter.
       */
      Install( ctx, RTEMS_INTERRUPT_SHARED, EntryRoutine, &entry_arg );
      break;
    }

    case RtemsIntrReqEntryInstall_Pre_Installed_NA:
      break;
  }
}

static void RtemsIntrReqEntryInstall_Post_Status_Check(
  RtemsIntrReqEntryInstall_Context    *ctx,
  RtemsIntrReqEntryInstall_Post_Status state
)
{
  switch ( state ) {
    case RtemsIntrReqEntryInstall_Post_Status_Ok: {
      /*
       * The return status of rtems_interrupt_entry_install() shall be
       * RTEMS_SUCCESSFUL.
       */
      T_rsc_success( ctx->status );
      break;
    }

    case RtemsIntrReqEntryInstall_Post_Status_InvAddr: {
      /*
       * The return status of rtems_interrupt_entry_install() shall be
       * RTEMS_INVALID_ADDRESS.
       */
      T_rsc( ctx->status, RTEMS_INVALID_ADDRESS );
      break;
    }

    case RtemsIntrReqEntryInstall_Post_Status_IncStat: {
      /*
       * The return status of rtems_interrupt_entry_install() shall be
       * RTEMS_INCORRECT_STATE.
       */
      T_rsc( ctx->status, RTEMS_INCORRECT_STATE );
      break;
    }

    case RtemsIntrReqEntryInstall_Post_Status_InvId: {
      /*
       * The return status of rtems_interrupt_entry_install() shall be
       * RTEMS_INVALID_ID.
       */
      T_rsc( ctx->status, RTEMS_INVALID_ID );
      break;
    }

    case RtemsIntrReqEntryInstall_Post_Status_InvNum: {
      /*
       * The return status of rtems_interrupt_entry_install() shall be
       * RTEMS_INVALID_NUMBER.
       */
      T_rsc( ctx->status, RTEMS_INVALID_NUMBER );
      break;
    }

    case RtemsIntrReqEntryInstall_Post_Status_CalledFromISR: {
      /*
       * The return status of rtems_interrupt_entry_install() shall be
       * RTEMS_CALLED_FROM_ISR.
       */
      T_rsc( ctx->status, RTEMS_CALLED_FROM_ISR );
      break;
    }

    case RtemsIntrReqEntryInstall_Post_Status_InUse: {
      /*
       * The return status of rtems_interrupt_entry_install() shall be
       * RTEMS_RESOURCE_IN_USE.
       */
      T_rsc( ctx->status, RTEMS_RESOURCE_IN_USE  );
      break;
    }

    case RtemsIntrReqEntryInstall_Post_Status_TooMany: {
      /*
       * The return status of rtems_interrupt_entry_install() shall be
       * RTEMS_TOO_MANY.
       */
      T_rsc( ctx->status, RTEMS_TOO_MANY );
      break;
    }

    case RtemsIntrReqEntryInstall_Post_Status_NA:
      break;
  }
}

static void RtemsIntrReqEntryInstall_Post_Enable_Check(
  RtemsIntrReqEntryInstall_Context    *ctx,
  RtemsIntrReqEntryInstall_Post_Enable state
)
{
  switch ( state ) {
    case RtemsIntrReqEntryInstall_Post_Enable_Nop: {
      /*
       * The enabled status of the interrupt vector specified by ``vector``
       * shall not be modified by the rtems_interrupt_entry_install() call.
       */
      if ( !ctx->interrupt_occurred ) {
        T_eq( ctx->enabled_before, ctx->enabled_after );
      }
      break;
    }

    case RtemsIntrReqEntryInstall_Post_Enable_Yes: {
      /*
       * The interrupt vector specified by ``vector`` shall be enabled.
       */
      if ( ctx->attributes.can_enable ) {
        T_true( ctx->enabled_after || ctx->interrupt_occurred );
      }
      break;
    }

    case RtemsIntrReqEntryInstall_Post_Enable_Maybe: {
      /*
       * The interrupt vector specified by ``vector`` may be enabled.
       */
      /* The comment of pre-condition ``CanEnable`` for the ``Yes`` state. */
      if ( ctx->attributes.can_enable ) {
        T_true( ctx->enabled_after || ctx->interrupt_occurred );
      }
      break;
    }

    case RtemsIntrReqEntryInstall_Post_Enable_No: {
      /*
       * The interrupt vector specified by ``vector`` shall not be enabled.
       */
      /*
       * Interrupt vectors which cannot be enabled are not selected as a
       * testable interrupt vector by GetTestableInterruptVector().
       */
      break;
    }

    case RtemsIntrReqEntryInstall_Post_Enable_NA:
      break;
  }
}

static void RtemsIntrReqEntryInstall_Post_Installed_Check(
  RtemsIntrReqEntryInstall_Context       *ctx,
  RtemsIntrReqEntryInstall_Post_Installed state
)
{
  rtems_status_code sc;

  ctx->visited_entries = 0;
  sc = rtems_interrupt_handler_iterate(
    ctx->test_vector,
    VisitInstalled,
    ctx
  );
  T_rsc_success( sc );

  switch ( state ) {
    case RtemsIntrReqEntryInstall_Post_Installed_No: {
      /*
       * The entry referenced by ``entry`` shall not be installed at the
       * interrupt vector specified by ``vector``.
       */
      if ( ctx->other_installed && ctx->third_installed ) {
        T_eq_u32( ctx->visited_entries, 2 );
      } else if ( ctx->other_installed ) {
        T_eq_u32( ctx->visited_entries, 1 );
      } else {
        T_eq_u32( ctx->visited_entries, 0 );
      }
      break;
    }

    case RtemsIntrReqEntryInstall_Post_Installed_Last: {
      /*
       * The entry referenced by ``entry`` shall be installed as the last entry
       * at the interrupt vector specified by ``vector``.
       */
      if ( ctx->other_installed && ctx->third_installed ) {
        T_eq_u32( ctx->visited_entries, 3 );
      } else if ( ctx->other_installed ) {
        T_eq_u32( ctx->visited_entries, 2 );
      } else {
        T_eq_u32( ctx->visited_entries, 1 );
      }
      break;
    }

    case RtemsIntrReqEntryInstall_Post_Installed_NA:
      break;
  }
}

static void RtemsIntrReqEntryInstall_Setup(
  RtemsIntrReqEntryInstall_Context *ctx
)
{
  rtems_status_code sc;

  ctx->initialized_during_setup = bsp_interrupt_is_initialized();
  ctx->test_vector = GetTestableInterruptVector();
  sc = rtems_interrupt_get_attributes( ctx->test_vector, &ctx->attributes );
  T_rsc_success( sc );
}

static void RtemsIntrReqEntryInstall_Setup_Wrap( void *arg )
{
  RtemsIntrReqEntryInstall_Context *ctx;

  ctx = arg;
  ctx->in_action_loop = false;
  RtemsIntrReqEntryInstall_Setup( ctx );
}

static void RtemsIntrReqEntryInstall_Prepare(
  RtemsIntrReqEntryInstall_Context *ctx
)
{
  ctx->interrupt_occurred = false;
  ctx->other_installed = false;
  ctx->third_installed = false;
}

static void RtemsIntrReqEntryInstall_Action(
  RtemsIntrReqEntryInstall_Context *ctx
)
{
  if ( ctx->isr ) {
    CallWithinISR( Action, ctx );
  } else {
    Action( ctx );
  }
}

static void RtemsIntrReqEntryInstall_Cleanup(
  RtemsIntrReqEntryInstall_Context *ctx
)
{
  rtems_status_code sc;

  if ( ctx->third_installed ) {
    sc = rtems_interrupt_entry_remove( ctx->test_vector, &ctx->third_entry );
    T_rsc_success( sc );
  }

  if ( ctx->other_installed ) {
    sc = rtems_interrupt_entry_remove( ctx->test_vector, &ctx->other_entry );
    T_rsc_success( sc );
  }

  if ( ctx->status == RTEMS_SUCCESSFUL ) {
    sc = rtems_interrupt_entry_remove( ctx->test_vector, ctx->entry );
    T_rsc_success( sc );
  }
}

typedef struct {
  uint32_t Skip : 1;
  uint32_t Pre_Vector_NA : 1;
  uint32_t Pre_Options_NA : 1;
  uint32_t Pre_Entry_NA : 1;
  uint32_t Pre_Routine_NA : 1;
  uint32_t Pre_Init_NA : 1;
  uint32_t Pre_ISR_NA : 1;
  uint32_t Pre_CanEnable_NA : 1;
  uint32_t Pre_Installed_NA : 1;
  uint32_t Post_Status : 4;
  uint32_t Post_Enable : 3;
  uint32_t Post_Installed : 2;
} RtemsIntrReqEntryInstall_Entry;

static const RtemsIntrReqEntryInstall_Entry
RtemsIntrReqEntryInstall_Entries[] = {
  { 0, 0, 0, 0, 1, 0, 0, 0, 0, RtemsIntrReqEntryInstall_Post_Status_InvAddr,
    RtemsIntrReqEntryInstall_Post_Enable_Nop,
    RtemsIntrReqEntryInstall_Post_Installed_NA },
  { 0, 0, 0, 0, 1, 0, 0, 1, 1, RtemsIntrReqEntryInstall_Post_Status_InvAddr,
    RtemsIntrReqEntryInstall_Post_Enable_NA,
    RtemsIntrReqEntryInstall_Post_Installed_NA },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, RtemsIntrReqEntryInstall_Post_Status_IncStat,
    RtemsIntrReqEntryInstall_Post_Enable_Nop,
    RtemsIntrReqEntryInstall_Post_Installed_No },
  { 0, 0, 0, 0, 0, 0, 0, 1, 1, RtemsIntrReqEntryInstall_Post_Status_IncStat,
    RtemsIntrReqEntryInstall_Post_Enable_NA,
    RtemsIntrReqEntryInstall_Post_Installed_NA },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, RtemsIntrReqEntryInstall_Post_Status_InvAddr,
    RtemsIntrReqEntryInstall_Post_Enable_Nop,
    RtemsIntrReqEntryInstall_Post_Installed_No },
  { 0, 0, 0, 0, 0, 0, 0, 1, 1, RtemsIntrReqEntryInstall_Post_Status_InvId,
    RtemsIntrReqEntryInstall_Post_Enable_NA,
    RtemsIntrReqEntryInstall_Post_Installed_NA },
  { 0, 0, 0, 0, 0, 0, 0, 1, 1, RtemsIntrReqEntryInstall_Post_Status_InvAddr,
    RtemsIntrReqEntryInstall_Post_Enable_NA,
    RtemsIntrReqEntryInstall_Post_Installed_NA },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0,
    RtemsIntrReqEntryInstall_Post_Status_CalledFromISR,
    RtemsIntrReqEntryInstall_Post_Enable_Nop,
    RtemsIntrReqEntryInstall_Post_Installed_No },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, RtemsIntrReqEntryInstall_Post_Status_InUse,
    RtemsIntrReqEntryInstall_Post_Enable_Nop,
    RtemsIntrReqEntryInstall_Post_Installed_No },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, RtemsIntrReqEntryInstall_Post_Status_InvNum,
    RtemsIntrReqEntryInstall_Post_Enable_Nop,
    RtemsIntrReqEntryInstall_Post_Installed_No },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, RtemsIntrReqEntryInstall_Post_Status_Ok,
    RtemsIntrReqEntryInstall_Post_Enable_Yes,
    RtemsIntrReqEntryInstall_Post_Installed_Last },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, RtemsIntrReqEntryInstall_Post_Status_Ok,
    RtemsIntrReqEntryInstall_Post_Enable_Maybe,
    RtemsIntrReqEntryInstall_Post_Installed_Last },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, RtemsIntrReqEntryInstall_Post_Status_Ok,
    RtemsIntrReqEntryInstall_Post_Enable_No,
    RtemsIntrReqEntryInstall_Post_Installed_Last },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, RtemsIntrReqEntryInstall_Post_Status_TooMany,
    RtemsIntrReqEntryInstall_Post_Enable_Nop,
    RtemsIntrReqEntryInstall_Post_Installed_No }
};

static const uint8_t
RtemsIntrReqEntryInstall_Map[] = {
  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 10, 8, 8, 8, 8, 8, 11,
  8, 8, 8, 8, 8, 12, 8, 8, 8, 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  2, 2, 2, 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, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
};

static size_t RtemsIntrReqEntryInstall_Scope( void *arg, char *buf, size_t n )
{
  RtemsIntrReqEntryInstall_Context *ctx;

  ctx = arg;

  if ( ctx->in_action_loop ) {
    return T_get_scope( RtemsIntrReqEntryInstall_PreDesc, buf, n, ctx->pcs );
  }

  return 0;
}

static T_fixture RtemsIntrReqEntryInstall_Fixture = {
  .setup = RtemsIntrReqEntryInstall_Setup_Wrap,
  .stop = NULL,
  .teardown = NULL,
  .scope = RtemsIntrReqEntryInstall_Scope,
  .initial_context = &RtemsIntrReqEntryInstall_Instance
};

static inline RtemsIntrReqEntryInstall_Entry RtemsIntrReqEntryInstall_GetEntry(
  size_t index
)
{
  return RtemsIntrReqEntryInstall_Entries[
    RtemsIntrReqEntryInstall_Map[ index ]
  ];
}

/**
 * @fn void T_case_body_RtemsIntrReqEntryInstall( void )
 */
T_TEST_CASE_FIXTURE(
  RtemsIntrReqEntryInstall,
  &RtemsIntrReqEntryInstall_Fixture
)
{
  RtemsIntrReqEntryInstall_Context *ctx;
  size_t index;

  ctx = T_fixture_context();
  ctx->in_action_loop = true;
  index = 0;

  for (
    ctx->pcs[ 0 ] = RtemsIntrReqEntryInstall_Pre_Vector_Valid;
    ctx->pcs[ 0 ] < RtemsIntrReqEntryInstall_Pre_Vector_NA;
    ++ctx->pcs[ 0 ]
  ) {
    for (
      ctx->pcs[ 1 ] = RtemsIntrReqEntryInstall_Pre_Options_Unique;
      ctx->pcs[ 1 ] < RtemsIntrReqEntryInstall_Pre_Options_NA;
      ++ctx->pcs[ 1 ]
    ) {
      for (
        ctx->pcs[ 2 ] = RtemsIntrReqEntryInstall_Pre_Entry_Obj;
        ctx->pcs[ 2 ] < RtemsIntrReqEntryInstall_Pre_Entry_NA;
        ++ctx->pcs[ 2 ]
      ) {
        for (
          ctx->pcs[ 3 ] = RtemsIntrReqEntryInstall_Pre_Routine_Valid;
          ctx->pcs[ 3 ] < RtemsIntrReqEntryInstall_Pre_Routine_NA;
          ++ctx->pcs[ 3 ]
        ) {
          for (
            ctx->pcs[ 4 ] = RtemsIntrReqEntryInstall_Pre_Init_Yes;
            ctx->pcs[ 4 ] < RtemsIntrReqEntryInstall_Pre_Init_NA;
            ++ctx->pcs[ 4 ]
          ) {
            for (
              ctx->pcs[ 5 ] = RtemsIntrReqEntryInstall_Pre_ISR_Yes;
              ctx->pcs[ 5 ] < RtemsIntrReqEntryInstall_Pre_ISR_NA;
              ++ctx->pcs[ 5 ]
            ) {
              for (
                ctx->pcs[ 6 ] = RtemsIntrReqEntryInstall_Pre_CanEnable_Yes;
                ctx->pcs[ 6 ] < RtemsIntrReqEntryInstall_Pre_CanEnable_NA;
                ++ctx->pcs[ 6 ]
              ) {
                for (
                  ctx->pcs[ 7 ] = RtemsIntrReqEntryInstall_Pre_Installed_None;
                  ctx->pcs[ 7 ] < RtemsIntrReqEntryInstall_Pre_Installed_NA;
                  ++ctx->pcs[ 7 ]
                ) {
                  RtemsIntrReqEntryInstall_Entry entry;
                  size_t pcs[ 8 ];

                  entry = RtemsIntrReqEntryInstall_GetEntry( index );
                  ++index;

                  memcpy( pcs, ctx->pcs, sizeof( pcs ) );

                  if ( entry.Pre_Routine_NA ) {
                    ctx->pcs[ 3 ] = RtemsIntrReqEntryInstall_Pre_Routine_NA;
                  }

                  if ( entry.Pre_CanEnable_NA ) {
                    ctx->pcs[ 6 ] = RtemsIntrReqEntryInstall_Pre_CanEnable_NA;
                  }

                  if ( entry.Pre_Installed_NA ) {
                    ctx->pcs[ 7 ] = RtemsIntrReqEntryInstall_Pre_Installed_NA;
                  }

                  RtemsIntrReqEntryInstall_Prepare( ctx );
                  RtemsIntrReqEntryInstall_Pre_Vector_Prepare(
                    ctx,
                    ctx->pcs[ 0 ]
                  );
                  RtemsIntrReqEntryInstall_Pre_Options_Prepare(
                    ctx,
                    ctx->pcs[ 1 ]
                  );
                  RtemsIntrReqEntryInstall_Pre_Entry_Prepare(
                    ctx,
                    ctx->pcs[ 2 ]
                  );
                  RtemsIntrReqEntryInstall_Pre_Routine_Prepare(
                    ctx,
                    ctx->pcs[ 3 ]
                  );
                  RtemsIntrReqEntryInstall_Pre_Init_Prepare(
                    ctx,
                    ctx->pcs[ 4 ]
                  );
                  RtemsIntrReqEntryInstall_Pre_ISR_Prepare(
                    ctx,
                    ctx->pcs[ 5 ]
                  );
                  RtemsIntrReqEntryInstall_Pre_CanEnable_Prepare(
                    ctx,
                    ctx->pcs[ 6 ]
                  );
                  RtemsIntrReqEntryInstall_Pre_Installed_Prepare(
                    ctx,
                    ctx->pcs[ 7 ]
                  );
                  RtemsIntrReqEntryInstall_Action( ctx );
                  RtemsIntrReqEntryInstall_Post_Status_Check(
                    ctx,
                    entry.Post_Status
                  );
                  RtemsIntrReqEntryInstall_Post_Enable_Check(
                    ctx,
                    entry.Post_Enable
                  );
                  RtemsIntrReqEntryInstall_Post_Installed_Check(
                    ctx,
                    entry.Post_Installed
                  );
                  RtemsIntrReqEntryInstall_Cleanup( ctx );
                  memcpy( ctx->pcs, pcs, sizeof( ctx->pcs ) );
                }
              }
            }
          }
        }
      }
    }
  }
}

/** @} */