summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-07-06 08:18:57 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-07-26 19:57:31 +0200
commitbfec448682f3ba9015d70a1371e2f120a80408fc (patch)
tree9078b48e68f853ad99e682cf3dfd2f4696ae3eed
parent1465e78a59869ddad0432bbe9815bcba891a2ad0 (diff)
downloadrtems-bfec448682f3ba9015d70a1371e2f120a80408fc.tar.bz2
validation: GetValidInterruptVectorNumber()
Update #3269.
-rw-r--r--testsuites/validation/tx-interrupt.c26
-rw-r--r--testsuites/validation/tx-support.h5
2 files changed, 31 insertions, 0 deletions
diff --git a/testsuites/validation/tx-interrupt.c b/testsuites/validation/tx-interrupt.c
index d056af5abc..0ff5ec017f 100644
--- a/testsuites/validation/tx-interrupt.c
+++ b/testsuites/validation/tx-interrupt.c
@@ -43,6 +43,32 @@
#include <rtems/irq-extension.h>
#include <rtems/test.h>
+#include <bsp/irq-generic.h>
+
+rtems_vector_number GetValidInterruptVectorNumber(
+ const rtems_interrupt_attributes *required
+)
+{
+ rtems_vector_number vector;
+
+ for ( vector = 0; vector < BSP_INTERRUPT_VECTOR_COUNT; ++vector ) {
+ rtems_status_code sc;
+ rtems_interrupt_attributes attr;
+
+ sc = rtems_interrupt_get_attributes( vector, &attr );
+
+ if (
+ sc == RTEMS_SUCCESSFUL &&
+ ( required == NULL ||
+ !required->can_get_affinity || attr.can_get_affinity )
+ ) {
+ break;
+ }
+ }
+
+ return vector;
+}
+
static void HasInstalled(
void *arg,
const char *info,
diff --git a/testsuites/validation/tx-support.h b/testsuites/validation/tx-support.h
index 378e98ee3f..20006f5dd8 100644
--- a/testsuites/validation/tx-support.h
+++ b/testsuites/validation/tx-support.h
@@ -38,6 +38,7 @@
#define _TX_SUPPORT_H
#include <rtems.h>
+#include <rtems/irq-extension.h>
#include <rtems/score/atomic.h>
#ifdef __cplusplus
@@ -113,6 +114,10 @@ void CallWithinISRSubmit( CallWithinISRRequest *request );
void CallWithinISRWait( const CallWithinISRRequest *request );
+rtems_vector_number GetValidInterruptVectorNumber(
+ const rtems_interrupt_attributes *required
+);
+
bool HasInterruptVectorEntriesInstalled( rtems_vector_number vector );
/** @} */