summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2023-01-23 14:56:31 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-01-24 09:56:53 +0100
commit10ee41a8a37ac5e8d3537cb1c7d98b647903b97c (patch)
tree1cc4168c02e2b963109393582af0cbb522dc5eda /testsuites
parentscore: Clarify code block (diff)
downloadrtems-10ee41a8a37ac5e8d3537cb1c7d98b647903b97c.tar.bz2
tm27: Avoid function pointer casts
Add TM27_USE_VECTOR_HANDLER to select the interrupt handler type used by the <tm27.h> implementation. Close #4820.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/rhealstone/rhilatency/ilatency.c26
-rw-r--r--testsuites/tmtests/tm27/task1.c100
-rw-r--r--testsuites/validation/tx-call-within-isr.c10
3 files changed, 69 insertions, 67 deletions
diff --git a/testsuites/rhealstone/rhilatency/ilatency.c b/testsuites/rhealstone/rhilatency/ilatency.c
index f4a450795f..2f6b185604 100644
--- a/testsuites/rhealstone/rhilatency/ilatency.c
+++ b/testsuites/rhealstone/rhilatency/ilatency.c
@@ -45,10 +45,6 @@ uint32_t Interrupt_nest;
uint32_t timer_overhead;
uint32_t Interrupt_enter_time;
-rtems_isr Isr_handler(
- rtems_vector_number vector
-);
-
rtems_task Init(
rtems_task_argument argument
)
@@ -91,6 +87,19 @@ rtems_task Init(
rtems_task_exit();
}
+#ifdef TM27_USE_VECTOR_HANDLER
+static rtems_isr Isr_handler( rtems_vector_number arg )
+#else
+static void Isr_handler( void *arg )
+#endif
+{
+ (void) arg;
+
+ /* See how long it took system to recognize interrupt */
+ Interrupt_enter_time = benchmark_timer_read();
+ Clear_tm27_intr();
+}
+
rtems_task Task_1(
rtems_task_argument argument
)
@@ -114,12 +123,3 @@ rtems_task Task_1(
TEST_END();
rtems_test_exit( 0 );
}
-
-rtems_isr Isr_handler(
- rtems_vector_number vector
-)
-{
- /* See how long it took system to recognize interrupt */
- Interrupt_enter_time = benchmark_timer_read();
- Clear_tm27_intr();
-}
diff --git a/testsuites/tmtests/tm27/task1.c b/testsuites/tmtests/tm27/task1.c
index 54aca545b8..7f2ce6663c 100644
--- a/testsuites/tmtests/tm27/task1.c
+++ b/testsuites/tmtests/tm27/task1.c
@@ -62,10 +62,6 @@ volatile uint32_t Interrupt_return_time, Interrupt_return_nested_time;
uint32_t Interrupt_nest;
uint32_t timer_overhead;
-rtems_isr Isr_handler(
- rtems_vector_number vector
-);
-
static void set_thread_executing( Thread_Control *thread )
{
_Per_CPU_Get_snapshot()->executing = thread;
@@ -126,6 +122,55 @@ rtems_task Init(
rtems_task_exit();
}
+/* The Isr_handler() and Isr_handler_inner() routines are structured
+ * so that there will be as little entry overhead as possible included
+ * in the interrupt entry time.
+ */
+
+static void Isr_handler_inner( void )
+{
+
+ /*enable_tracing();*/
+ Clear_tm27_intr();
+ switch ( Interrupt_nest ) {
+ case 0:
+ Interrupt_enter_time = end_time;
+ break;
+ case 1:
+ Interrupt_enter_time = end_time;
+ Interrupt_nest = 2;
+ Interrupt_occurred = 0;
+ Lower_tm27_intr();
+ benchmark_timer_initialize();
+ Cause_tm27_intr();
+ /* goes to a nested copy of Isr_handler */
+#if (MUST_WAIT_FOR_INTERRUPT == 1)
+ while ( Interrupt_occurred == 0 );
+#endif
+ Interrupt_return_nested_time = benchmark_timer_read();
+ break;
+ case 2:
+ Interrupt_enter_nested_time = end_time;
+ break;
+ }
+
+ benchmark_timer_initialize();
+}
+
+#ifdef TM27_USE_VECTOR_HANDLER
+static rtems_isr Isr_handler( rtems_vector_number arg )
+#else
+static void Isr_handler( void *arg )
+#endif
+{
+ (void) arg;
+
+ end_time = benchmark_timer_read();
+
+ Interrupt_occurred = 1;
+ Isr_handler_inner();
+}
+
rtems_task Task_1(
rtems_task_argument argument
)
@@ -302,50 +347,3 @@ rtems_task Task_2(
_Thread_Dispatch();
}
-
-/* The Isr_handler() and Isr_handler_inner() routines are structured
- * so that there will be as little entry overhead as possible included
- * in the interrupt entry time.
- */
-
-void Isr_handler_inner( void );
-
-rtems_isr Isr_handler(
- rtems_vector_number vector
-)
-{
- end_time = benchmark_timer_read();
-
- Interrupt_occurred = 1;
- Isr_handler_inner();
-}
-
-void Isr_handler_inner( void )
-{
-
- /*enable_tracing();*/
- Clear_tm27_intr();
- switch ( Interrupt_nest ) {
- case 0:
- Interrupt_enter_time = end_time;
- break;
- case 1:
- Interrupt_enter_time = end_time;
- Interrupt_nest = 2;
- Interrupt_occurred = 0;
- Lower_tm27_intr();
- benchmark_timer_initialize();
- Cause_tm27_intr();
- /* goes to a nested copy of Isr_handler */
-#if (MUST_WAIT_FOR_INTERRUPT == 1)
- while ( Interrupt_occurred == 0 );
-#endif
- Interrupt_return_nested_time = benchmark_timer_read();
- break;
- case 2:
- Interrupt_enter_nested_time = end_time;
- break;
- }
-
- benchmark_timer_initialize();
-}
diff --git a/testsuites/validation/tx-call-within-isr.c b/testsuites/validation/tx-call-within-isr.c
index 0767f96edf..91560b70b0 100644
--- a/testsuites/validation/tx-call-within-isr.c
+++ b/testsuites/validation/tx-call-within-isr.c
@@ -76,11 +76,15 @@ void CallWithinISRClear( void )
Clear_tm27_intr();
}
-static void CallWithinISRHandler( rtems_vector_number vector )
+#ifdef TM27_USE_VECTOR_HANDLER
+static rtems_isr CallWithinISRHandler( rtems_vector_number arg )
+#else
+static void CallWithinISRHandler( void *arg )
+#endif
{
CallWithinISRContext *ctx;
- (void) vector;
+ (void) arg;
ctx = &CallWithinISRInstance;
CallWithinISRClear();
@@ -148,7 +152,7 @@ static void CallWithinISRIsHandlerInstalled(
(void) option;
(void) handler_arg;
- if ( handler == (rtems_interrupt_handler) CallWithinISRHandler ) {
+ if ( handler == CallWithinISRHandler ) {
*(bool *) arg = true;
}
}