diff options
Diffstat (limited to 'testsuites/validation/tc-signal-catch.c')
-rw-r--r-- | testsuites/validation/tc-signal-catch.c | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/testsuites/validation/tc-signal-catch.c b/testsuites/validation/tc-signal-catch.c index 9c14cc93a3..7c3292ba71 100644 --- a/testsuites/validation/tc-signal-catch.c +++ b/testsuites/validation/tc-signal-catch.c @@ -251,11 +251,17 @@ static void RtemsSignalReqCatch_Pre_Handler_Prepare( { switch ( state ) { case RtemsSignalReqCatch_Pre_Handler_Invalid: { + /* + * The ``asr_handler`` parameter shall be NULL. + */ ctx->handler = NULL; break; } case RtemsSignalReqCatch_Pre_Handler_Valid: { + /* + * The ``asr_handler`` parameter shall be a valid ASR handler. + */ ctx->handler = SignalHandler; break; } @@ -272,6 +278,10 @@ static void RtemsSignalReqCatch_Pre_Preempt_Prepare( { switch ( state ) { case RtemsSignalReqCatch_Pre_Preempt_Yes: { + /* + * The ``mode_set`` parameter shall specify that + * preemption is enabled. + */ #if defined(RTEMS_SMP) if ( rtems_configuration_get_maximum_processors() == 1 ) { ctx->normal_mode |= RTEMS_NO_PREEMPT; @@ -283,6 +293,10 @@ static void RtemsSignalReqCatch_Pre_Preempt_Prepare( } case RtemsSignalReqCatch_Pre_Preempt_No: { + /* + * The ``mode_set`` parameter shall specify that + * preemption is disabled. + */ ctx->mode |= RTEMS_NO_PREEMPT; break; } @@ -299,11 +313,19 @@ static void RtemsSignalReqCatch_Pre_Timeslice_Prepare( { switch ( state ) { case RtemsSignalReqCatch_Pre_Timeslice_Yes: { + /* + * The ``mode_set`` parameter shall specify that + * timeslicing is enabled. + */ ctx->mode |= RTEMS_TIMESLICE; break; } case RtemsSignalReqCatch_Pre_Timeslice_No: { + /* + * The ``mode_set`` parameter shall specify that + * timeslicing is disabled. + */ ctx->normal_mode |= RTEMS_TIMESLICE; break; } @@ -320,11 +342,19 @@ static void RtemsSignalReqCatch_Pre_ASR_Prepare( { switch ( state ) { case RtemsSignalReqCatch_Pre_ASR_Yes: { + /* + * The ``mode_set`` parameter shall specify that + * ASR processing is enabled. + */ /* We cannot disable ASR processing at normal task level for this test */ break; } case RtemsSignalReqCatch_Pre_ASR_No: { + /* + * The ``mode_set`` parameter shall specify that + * ASR processing is disabled. + */ ctx->mode |= RTEMS_NO_ASR; break; } @@ -341,6 +371,10 @@ static void RtemsSignalReqCatch_Pre_IntLvl_Prepare( { switch ( state ) { case RtemsSignalReqCatch_Pre_IntLvl_Zero: { + /* + * The ``mode_set`` parameter shall specify an interrupt + * level of zero. + */ #if !defined(RTEMS_SMP) && CPU_ENABLE_ROBUST_THREAD_DISPATCH == FALSE ctx->normal_mode |= RTEMS_INTERRUPT_LEVEL( 1 ); #endif @@ -348,6 +382,10 @@ static void RtemsSignalReqCatch_Pre_IntLvl_Prepare( } case RtemsSignalReqCatch_Pre_IntLvl_Positive: { + /* + * The ``mode_set`` parameter shall specify a positive + * interrupt level. + */ ctx->mode |= RTEMS_INTERRUPT_LEVEL( 1 ); break; } @@ -364,11 +402,21 @@ static void RtemsSignalReqCatch_Post_Status_Check( { switch ( state ) { case RtemsSignalReqCatch_Post_Status_Ok: { + /* + * The return status of rtems_signal_catch() shall be + * RTEMS_SUCCESSFUL. + */ T_rsc_success( ctx->catch_status ); break; } case RtemsSignalReqCatch_Post_Status_NotImplNoPreempt: { + /* + * Where the system is configured with SMP support, if the scheduler does + * not support the no-preempt mode, then the return status of + * rtems_signal_catch() shall be RTEMS_NOT_IMPLEMENTED, + * otherwise the return status shall be RTEMS_SUCCESSFUL. + */ #if defined(RTEMS_SMP) if ( rtems_configuration_get_maximum_processors() > 1 ) { T_rsc( ctx->catch_status, RTEMS_NOT_IMPLEMENTED ); @@ -382,6 +430,13 @@ static void RtemsSignalReqCatch_Post_Status_Check( } case RtemsSignalReqCatch_Post_Status_NotImplIntLvl: { + /* + * Where the system is configured with SMP support and the configured + * processor maximum is greater than one, or the CPU port enabled robust + * thread dispatching, the return status of rtems_signal_catch() shall be + * RTEMS_NOT_IMPLEMENTED, otherwise the return status + * shall be RTEMS_SUCCESSFUL. + */ #if CPU_ENABLE_ROBUST_THREAD_DISPATCH == TRUE T_rsc( ctx->catch_status, RTEMS_NOT_IMPLEMENTED ); #elif defined(RTEMS_SMP) @@ -408,6 +463,11 @@ static void RtemsSignalReqCatch_Post_Send_Check( { switch ( state ) { case RtemsSignalReqCatch_Post_Send_New: { + /* + * When a signal set is sent to the caller of rtems_signal_catch() and the + * call was successful, the ASR processing shall be done with the specified + * handler, otherwise the ASR information of the caller shall be unchanged. + */ T_rsc_success( ctx->send_status ); if ( ctx->catch_status == RTEMS_SUCCESSFUL ) { @@ -423,6 +483,12 @@ static void RtemsSignalReqCatch_Post_Send_Check( } case RtemsSignalReqCatch_Post_Send_NotDef: { + /* + * When a signal set is sent to the caller of rtems_signal_catch() and the + * call was successful, the ASR processing shall be deactivated and all + * pending signals shall be cleared, otherwise the ASR information of the + * caller shall be unchanged. + */ if ( ctx->catch_status == RTEMS_SUCCESSFUL ) { T_rsc( ctx->send_status, RTEMS_NOT_DEFINED ); T_eq_u32( ctx->default_handler_calls, 0 ); @@ -449,11 +515,21 @@ static void RtemsSignalReqCatch_Post_Preempt_Check( { switch ( state ) { case RtemsSignalReqCatch_Post_Preempt_Yes: { + /* + * When a signal set is sent to the caller of rtems_signal_catch() and the + * call with a valid handler was successful, the ASR processing shall be + * done with preemption enabled. + */ CheckHandlerMode( ctx, RTEMS_PREEMPT_MASK, RTEMS_PREEMPT ); break; } case RtemsSignalReqCatch_Post_Preempt_No: { + /* + * When a signal set is sent to the caller of rtems_signal_catch() and the + * call with a valid handler was successful, the ASR processing shall be + * done with preemption disabled. + */ CheckHandlerMode( ctx, RTEMS_PREEMPT_MASK, RTEMS_NO_PREEMPT ); break; } @@ -470,11 +546,21 @@ static void RtemsSignalReqCatch_Post_Timeslice_Check( { switch ( state ) { case RtemsSignalReqCatch_Post_Timeslice_Yes: { + /* + * When a signal set is sent to the caller of rtems_signal_catch() and the + * call with a valid handler was successful, the ASR processing shall be + * done with timeslicing enabled. + */ CheckHandlerMode( ctx, RTEMS_TIMESLICE_MASK, RTEMS_TIMESLICE ); break; } case RtemsSignalReqCatch_Post_Timeslice_No: { + /* + * When a signal set is sent to the caller of rtems_signal_catch() and the + * call with a valid handler was successful, the ASR processing shall be + * done with timeslicing disabled. + */ CheckHandlerMode( ctx, RTEMS_TIMESLICE_MASK, RTEMS_NO_TIMESLICE ); break; } @@ -491,11 +577,21 @@ static void RtemsSignalReqCatch_Post_ASR_Check( { switch ( state ) { case RtemsSignalReqCatch_Post_ASR_Yes: { + /* + * When a signal set is sent to the caller of rtems_signal_catch() and the + * call with a valid handler was successful, the ASR processing shall be + * done with ASR processing enabled. + */ CheckHandlerMode( ctx, RTEMS_ASR_MASK, RTEMS_ASR ); break; } case RtemsSignalReqCatch_Post_ASR_No: { + /* + * When a signal set is sent to the caller of rtems_signal_catch() and the + * call with a valid handler was successful, the ASR processing shall be + * done with ASR processing disabled. + */ CheckHandlerMode( ctx, RTEMS_ASR_MASK, RTEMS_NO_ASR ); break; } @@ -512,11 +608,21 @@ static void RtemsSignalReqCatch_Post_IntLvl_Check( { switch ( state ) { case RtemsSignalReqCatch_Post_IntLvl_Zero: { + /* + * When a signal set is sent to the caller of rtems_signal_catch() and the + * call with a valid handler was successful, the ASR processing shall be + * done with interrupts enabled. + */ CheckHandlerMode( ctx, RTEMS_INTERRUPT_MASK, RTEMS_INTERRUPT_LEVEL( 0 ) ); break; } case RtemsSignalReqCatch_Post_IntLvl_Positive: { + /* + * When a signal set is sent to the caller of rtems_signal_catch() and the + * call with a valid handler was successful, the ASR processing shall be + * done with interrupts disabled according to the specified interrupt level. + */ CheckHandlerMode( ctx, RTEMS_INTERRUPT_MASK, RTEMS_INTERRUPT_LEVEL( 1 ) ); break; } |