File indexing completed on 2025-05-11 08:24:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
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
0064
0065
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
0168
0169 typedef struct {
0170
0171
0172
0173
0174 bool initialized_during_setup;
0175
0176
0177
0178
0179 bool interrupt_occurred;
0180
0181
0182
0183
0184 uint32_t entry_counter;
0185
0186
0187
0188
0189 rtems_interrupt_entry other_entry;
0190
0191
0192
0193
0194 bool other_installed;
0195
0196
0197
0198
0199 rtems_interrupt_entry third_entry;
0200
0201
0202
0203
0204 bool third_installed;
0205
0206
0207
0208
0209 bool installed;
0210
0211
0212
0213
0214
0215 bool first;
0216
0217
0218
0219
0220
0221 bool last;
0222
0223
0224
0225
0226
0227 bool match;
0228
0229
0230
0231
0232
0233 rtems_vector_number test_vector;
0234
0235
0236
0237
0238
0239 bool test_vector_was_enabled;
0240
0241
0242
0243
0244
0245 rtems_interrupt_attributes attributes;
0246
0247
0248
0249
0250 bool initialized;
0251
0252
0253
0254
0255
0256 bool isr;
0257
0258
0259
0260
0261
0262 bool enabled_before;
0263
0264
0265
0266
0267
0268 bool enabled_after;
0269
0270
0271
0272
0273 uint32_t visited_entries;
0274
0275
0276
0277
0278 rtems_interrupt_entry entry_obj;
0279
0280
0281
0282
0283 rtems_vector_number vector;
0284
0285
0286
0287
0288 rtems_interrupt_entry *entry;
0289
0290
0291
0292
0293
0294 rtems_status_code status;
0295
0296 struct {
0297
0298
0299
0300
0301 size_t pci[ 9 ];
0302
0303
0304
0305
0306 size_t pcs[ 9 ];
0307
0308
0309
0310
0311 bool in_action_loop;
0312
0313
0314
0315
0316 size_t index;
0317
0318
0319
0320
0321 RtemsIntrReqEntryRemove_Entry entry;
0322
0323
0324
0325
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
0586
0587 ctx->vector = ctx->test_vector;
0588 break;
0589 }
0590
0591 case RtemsIntrReqEntryRemove_Pre_Vector_Invalid: {
0592
0593
0594
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
0614
0615
0616 ctx->entry = &ctx->entry_obj;
0617 break;
0618 }
0619
0620 case RtemsIntrReqEntryRemove_Pre_Entry_Null: {
0621
0622
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
0642
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
0656
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
0681
0682
0683 ctx->installed = true;
0684 break;
0685 }
0686
0687 case RtemsIntrReqEntryRemove_Pre_EntryObj_Match: {
0688
0689
0690
0691
0692
0693
0694
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
0705
0706
0707
0708
0709
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
0731
0732 ctx->initialized = true;
0733 break;
0734 }
0735
0736 case RtemsIntrReqEntryRemove_Pre_Init_No: {
0737
0738
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
0758
0759
0760 ctx->isr = true;
0761 break;
0762 }
0763
0764 case RtemsIntrReqEntryRemove_Pre_ISR_No: {
0765
0766
0767
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
0787
0788
0789
0790
0791
0792
0793
0794
0795
0796 break;
0797 }
0798
0799 case RtemsIntrReqEntryRemove_Pre_CanDisable_Maybe: {
0800
0801
0802
0803
0804
0805 break;
0806 }
0807
0808 case RtemsIntrReqEntryRemove_Pre_CanDisable_No: {
0809
0810
0811
0812
0813
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
0831
0832
0833
0834 ctx->first = true;
0835 break;
0836 }
0837
0838 case RtemsIntrReqEntryRemove_Pre_First_No: {
0839
0840
0841
0842
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
0862
0863
0864
0865 ctx->last = true;
0866 break;
0867 }
0868
0869 case RtemsIntrReqEntryRemove_Pre_Last_No: {
0870
0871
0872
0873
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
0893
0894
0895 T_rsc_success( ctx->status );
0896 break;
0897 }
0898
0899 case RtemsIntrReqEntryRemove_Post_Status_InvAddr: {
0900
0901
0902
0903
0904 T_rsc( ctx->status, RTEMS_INVALID_ADDRESS );
0905 break;
0906 }
0907
0908 case RtemsIntrReqEntryRemove_Post_Status_IncStat: {
0909
0910
0911
0912
0913 T_rsc( ctx->status, RTEMS_INCORRECT_STATE );
0914 break;
0915 }
0916
0917 case RtemsIntrReqEntryRemove_Post_Status_InvId: {
0918
0919
0920
0921
0922 T_rsc( ctx->status, RTEMS_INVALID_ID );
0923 break;
0924 }
0925
0926 case RtemsIntrReqEntryRemove_Post_Status_CalledFromISR: {
0927
0928
0929
0930
0931 T_rsc( ctx->status, RTEMS_CALLED_FROM_ISR );
0932 break;
0933 }
0934
0935 case RtemsIntrReqEntryRemove_Post_Status_Unsat: {
0936
0937
0938
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
0958
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
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
0979
0980
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
0990
0991
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
1015
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
1053
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,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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1298 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,
1299 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
1300 };
1301
1302 static size_t RtemsIntrReqEntryRemove_Scope( void *arg, char *buf, size_t n )
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
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