summaryrefslogtreecommitdiffstats
path: root/testsuites/validation/tc-intr-entry-remove.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testsuites/validation/tc-intr-entry-remove.c52
1 files changed, 40 insertions, 12 deletions
diff --git a/testsuites/validation/tc-intr-entry-remove.c b/testsuites/validation/tc-intr-entry-remove.c
index c73bcbb3fc..01a72410e1 100644
--- a/testsuites/validation/tc-intr-entry-remove.c
+++ b/testsuites/validation/tc-intr-entry-remove.c
@@ -3,11 +3,11 @@
/**
* @file
*
- * @ingroup RTEMSTestCaseRtemsIntrReqEntryRemove
+ * @ingroup RtemsIntrReqEntryRemove
*/
/*
- * 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 RTEMSTestCaseRtemsIntrReqEntryRemove \
- * spec:/rtems/intr/req/entry-remove
+ * @defgroup RtemsIntrReqEntryRemove spec:/rtems/intr/req/entry-remove
*
- * @ingroup RTEMSTestSuiteTestsuitesValidationIntr
+ * @ingroup TestsuitesValidationIntr
*
* @{
*/
@@ -182,7 +181,7 @@ typedef struct {
/**
* @brief This member provides a counter incremented by EntryRoutine().
*/
- uint32_t entry_counter;;
+ uint32_t entry_counter;
/**
* @brief This member provides another rtems_interrupt_entry object.
@@ -234,6 +233,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.
*/
@@ -280,7 +285,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
@@ -473,14 +478,14 @@ 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
);
ctx->status = rtems_interrupt_entry_remove( ctx->vector, ctx->entry );
bsp_interrupt_set_handler_unique(
- BSP_INTERRUPT_HANDLER_TABLE_SIZE,
+ BSP_INTERRUPT_DISPATCH_TABLE_SIZE,
ctx->initialized_during_setup
);
@@ -1034,8 +1039,8 @@ static void RtemsIntrReqEntryRemove_Post_Installed_Check(
} else {
rtems_interrupt_entry *first;
- first = bsp_interrupt_handler_table[
- bsp_interrupt_handler_index( ctx->test_vector )
+ first = bsp_interrupt_dispatch_table[
+ bsp_interrupt_dispatch_index( ctx->test_vector )
];
T_null( first );
}
@@ -1088,6 +1093,11 @@ static void RtemsIntrReqEntryRemove_Setup(
ctx->initialized_during_setup = bsp_interrupt_is_initialized();
ctx->test_vector = GetTestableInterruptVector( NULL );
+ 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 );
}
@@ -1101,6 +1111,24 @@ static void RtemsIntrReqEntryRemove_Setup_Wrap( void *arg )
RtemsIntrReqEntryRemove_Setup( ctx );
}
+static void RtemsIntrReqEntryRemove_Teardown(
+ RtemsIntrReqEntryRemove_Context *ctx
+)
+{
+ if ( ctx->test_vector_was_enabled ) {
+ (void) rtems_interrupt_vector_enable( ctx->test_vector );
+ }
+}
+
+static void RtemsIntrReqEntryRemove_Teardown_Wrap( void *arg )
+{
+ RtemsIntrReqEntryRemove_Context *ctx;
+
+ ctx = arg;
+ ctx->Map.in_action_loop = false;
+ RtemsIntrReqEntryRemove_Teardown( ctx );
+}
+
static void RtemsIntrReqEntryRemove_Prepare(
RtemsIntrReqEntryRemove_Context *ctx
)
@@ -1292,7 +1320,7 @@ static size_t RtemsIntrReqEntryRemove_Scope( void *arg, char *buf, size_t n )
static T_fixture RtemsIntrReqEntryRemove_Fixture = {
.setup = RtemsIntrReqEntryRemove_Setup_Wrap,
.stop = NULL,
- .teardown = NULL,
+ .teardown = RtemsIntrReqEntryRemove_Teardown_Wrap,
.scope = RtemsIntrReqEntryRemove_Scope,
.initial_context = &RtemsIntrReqEntryRemove_Instance
};