summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2023-12-18 12:02:31 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-12-19 08:26:46 +0100
commit93f927de26d9e5504e548c99533f2de197682a83 (patch)
tree8d2e2e7ab8cff1b726046000efcb608b67e44b37
parenttm27: Add optional TM27_INTERRUPT_VECTOR_DEFAULT (diff)
downloadrtems-93f927de26d9e5504e548c99533f2de197682a83.tar.bz2
tm27: Add TM27_INTERRUPT_VECTOR_ALTERNATIVE
The TM27 support may define TM27_INTERRUPT_VECTOR_ALTERNATIVE to provide an alternative software generated interrupt request which is raised by _TM27_Raise_alternative() and cleared by _TM27_Clear_alternative(). Both functions shall return an RTEMS status code. This interrupt vector may be used to test the interrupt controller support on targets which do not provide generic software generated interrupts. Update #3716.
-rw-r--r--cpukit/doxygen.h7
-rw-r--r--testsuites/validation/tc-intr-entry-install.c9
-rw-r--r--testsuites/validation/tx-call-within-isr.c31
-rw-r--r--testsuites/validation/tx-interrupt.c4
-rw-r--r--testsuites/validation/tx-support.h6
5 files changed, 51 insertions, 6 deletions
diff --git a/cpukit/doxygen.h b/cpukit/doxygen.h
index e61b207a7a..a1ba3ece4a 100644
--- a/cpukit/doxygen.h
+++ b/cpukit/doxygen.h
@@ -60,6 +60,13 @@
*
* The TM27 support may define TM27_INTERRUPT_VECTOR_DEFAULT to indicate the
* interrupt vector of the interrupt request raised by Cause_tm27_intr().
+ *
+ * The TM27 support may define TM27_INTERRUPT_VECTOR_ALTERNATIVE to provide an
+ * alternative software generated interrupt request which is raised by
+ * _TM27_Raise_alternative() and cleared by _TM27_Clear_alternative(). Both
+ * functions shall return an RTEMS status code. This interrupt vector may be
+ * used to test the interrupt controller support on targets which do not
+ * provide generic software generated interrupts.
*/
/**
diff --git a/testsuites/validation/tc-intr-entry-install.c b/testsuites/validation/tc-intr-entry-install.c
index d1fa470d0c..58c7989dbe 100644
--- a/testsuites/validation/tc-intr-entry-install.c
+++ b/testsuites/validation/tc-intr-entry-install.c
@@ -431,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 );
}
@@ -544,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 );
}
}
diff --git a/testsuites/validation/tx-call-within-isr.c b/testsuites/validation/tx-call-within-isr.c
index a7fce4368d..8bbe0e7c29 100644
--- a/testsuites/validation/tx-call-within-isr.c
+++ b/testsuites/validation/tx-call-within-isr.c
@@ -185,6 +185,37 @@ rtems_vector_number CallWithinISRGetVector( void )
#endif
}
+rtems_vector_number GetSoftwareInterruptVector( void )
+{
+#if defined( TM27_INTERRUPT_VECTOR_ALTERNATIVE )
+ return TM27_INTERRUPT_VECTOR_ALTERNATIVE;
+#else
+ return UINT32_MAX;
+#endif
+}
+
+rtems_status_code RaiseSoftwareInterrupt( rtems_vector_number vector )
+{
+#if defined( TM27_INTERRUPT_VECTOR_ALTERNATIVE )
+ if ( vector == TM27_INTERRUPT_VECTOR_ALTERNATIVE ) {
+ return _TM27_Raise_alternative();
+ }
+#endif
+
+ return rtems_interrupt_raise( vector );
+}
+
+rtems_status_code ClearSoftwareInterrupt( rtems_vector_number vector )
+{
+#if defined( TM27_INTERRUPT_VECTOR_ALTERNATIVE )
+ if ( vector == TM27_INTERRUPT_VECTOR_ALTERNATIVE ) {
+ return _TM27_Clear_alternative();
+ }
+#endif
+
+ return rtems_interrupt_clear( vector );
+}
+
static void CallWithinISRInitialize( void )
{
Install_tm27_vector( CallWithinISRHandler );
diff --git a/testsuites/validation/tx-interrupt.c b/testsuites/validation/tx-interrupt.c
index 400ccdf070..c5ea4142c2 100644
--- a/testsuites/validation/tx-interrupt.c
+++ b/testsuites/validation/tx-interrupt.c
@@ -139,6 +139,10 @@ rtems_vector_number GetTestableInterruptVector(
}
}
+ if ( vector == BSP_INTERRUPT_VECTOR_COUNT ) {
+ vector = GetSoftwareInterruptVector();
+ }
+
return vector;
}
diff --git a/testsuites/validation/tx-support.h b/testsuites/validation/tx-support.h
index e83b461e2b..378bc4c466 100644
--- a/testsuites/validation/tx-support.h
+++ b/testsuites/validation/tx-support.h
@@ -396,6 +396,8 @@ void CallWithinISRClear( void );
rtems_vector_number CallWithinISRGetVector( void );
+rtems_vector_number GetSoftwareInterruptVector( void );
+
typedef struct {
Thread_queue_Operations tq_ops;
const Thread_queue_Operations *wrapped_ops;
@@ -437,6 +439,10 @@ rtems_vector_number GetTestableInterruptVector(
const rtems_interrupt_attributes *required
);
+rtems_status_code RaiseSoftwareInterrupt( rtems_vector_number vector );
+
+rtems_status_code ClearSoftwareInterrupt( rtems_vector_number vector );
+
bool HasInterruptVectorEntriesInstalled( rtems_vector_number vector );
/**