summaryrefslogtreecommitdiffstats
path: root/testsuites/validation/tc-intr-entry-install.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testsuites/validation/tc-intr-entry-install.c57
1 files changed, 41 insertions, 16 deletions
diff --git a/testsuites/validation/tc-intr-entry-install.c b/testsuites/validation/tc-intr-entry-install.c
index 714486772a..58c7989dbe 100644
--- a/testsuites/validation/tc-intr-entry-install.c
+++ b/testsuites/validation/tc-intr-entry-install.c
@@ -3,11 +3,11 @@
/**
* @file
*
- * @ingroup RTEMSTestCaseRtemsIntrReqEntryInstall
+ * @ingroup RtemsIntrReqEntryInstall
*/
/*
- * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2021 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -60,10 +60,9 @@
#include <rtems/test.h>
/**
- * @defgroup RTEMSTestCaseRtemsIntrReqEntryInstall \
- * spec:/rtems/intr/req/entry-install
+ * @defgroup RtemsIntrReqEntryInstall spec:/rtems/intr/req/entry-install
*
- * @ingroup RTEMSTestSuiteTestsuitesValidationIntr
+ * @ingroup TestsuitesValidationIntr
*
* @{
*/
@@ -181,7 +180,7 @@ typedef struct {
/**
* @brief This member provides a counter snapshot for each entry.
*/
- uint32_t counter_by_entry[ 3 ];;
+ uint32_t counter_by_entry[ 3 ];
/**
* @brief This member provides the vector number of a testable interrupt
@@ -190,6 +189,12 @@ typedef struct {
rtems_vector_number test_vector;
/**
+ * @brief If this member is true, then the testable interrupt vector was
+ * enabled at the test case begin.
+ */
+ bool test_vector_was_enabled;
+
+ /**
* @brief This member provides the attributes of the testable interrupt
* vector.
*/
@@ -267,7 +272,7 @@ typedef struct {
/**
* @brief This member specifies if the ``entry`` parameter value.
*/
- rtems_interrupt_entry *entry;;
+ rtems_interrupt_entry *entry;
/**
* @brief This member contains the return value of the
@@ -426,11 +431,8 @@ static void Routine( Context *ctx, uint32_t counter )
ctx->handler_counter = counter;
- if (
- ctx->attributes.can_clear &&
- !ctx->attributes.cleared_by_acknowledge
- ) {
- sc = rtems_interrupt_clear( ctx->test_vector );
+ if ( !ctx->attributes.cleared_by_acknowledge ) {
+ sc = ClearSoftwareInterrupt( ctx->test_vector );
T_rsc_success( sc );
}
@@ -517,7 +519,7 @@ static void Action( void *arg )
T_rsc_success( sc );
bsp_interrupt_set_handler_unique(
- BSP_INTERRUPT_HANDLER_TABLE_SIZE,
+ BSP_INTERRUPT_DISPATCH_TABLE_SIZE,
ctx->initialized
);
@@ -528,7 +530,7 @@ static void Action( void *arg )
);
bsp_interrupt_set_handler_unique(
- BSP_INTERRUPT_HANDLER_TABLE_SIZE,
+ BSP_INTERRUPT_DISPATCH_TABLE_SIZE,
ctx->initialized_during_setup
);
@@ -539,7 +541,7 @@ static void Action( void *arg )
T_rsc_success( sc );
if ( ctx->status == RTEMS_SUCCESSFUL ) {
- sc = rtems_interrupt_raise( ctx->test_vector );
+ sc = RaiseSoftwareInterrupt( ctx->test_vector );
T_rsc_success( sc );
}
}
@@ -1120,6 +1122,11 @@ static void RtemsIntrReqEntryInstall_Setup(
ctx->initialized_during_setup = bsp_interrupt_is_initialized();
ctx->test_vector = GetTestableInterruptVector( &required );
+ ctx->test_vector_was_enabled = false;
+ (void) rtems_interrupt_vector_is_enabled(
+ ctx->test_vector,
+ &ctx->test_vector_was_enabled
+ );
sc = rtems_interrupt_get_attributes( ctx->test_vector, &ctx->attributes );
T_rsc_success( sc );
}
@@ -1133,6 +1140,24 @@ static void RtemsIntrReqEntryInstall_Setup_Wrap( void *arg )
RtemsIntrReqEntryInstall_Setup( ctx );
}
+static void RtemsIntrReqEntryInstall_Teardown(
+ RtemsIntrReqEntryInstall_Context *ctx
+)
+{
+ if ( ctx->test_vector_was_enabled ) {
+ (void) rtems_interrupt_vector_enable( ctx->test_vector );
+ }
+}
+
+static void RtemsIntrReqEntryInstall_Teardown_Wrap( void *arg )
+{
+ RtemsIntrReqEntryInstall_Context *ctx;
+
+ ctx = arg;
+ ctx->Map.in_action_loop = false;
+ RtemsIntrReqEntryInstall_Teardown( ctx );
+}
+
static void RtemsIntrReqEntryInstall_Prepare(
RtemsIntrReqEntryInstall_Context *ctx
)
@@ -1320,7 +1345,7 @@ static size_t RtemsIntrReqEntryInstall_Scope( void *arg, char *buf, size_t n )
static T_fixture RtemsIntrReqEntryInstall_Fixture = {
.setup = RtemsIntrReqEntryInstall_Setup_Wrap,
.stop = NULL,
- .teardown = NULL,
+ .teardown = RtemsIntrReqEntryInstall_Teardown_Wrap,
.scope = RtemsIntrReqEntryInstall_Scope,
.initial_context = &RtemsIntrReqEntryInstall_Instance
};