summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/spintrcritical_support/intrcritical.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-09-08 15:18:07 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-09-10 07:12:55 +0200
commit802808900053e732881795d0d748d8fdc2a54e13 (patch)
tree7e9c96202fc39ce59cbd1c7d19806348631f2d14 /testsuites/sptests/spintrcritical_support/intrcritical.h
parentscore: More strict RTEMS_DEQUALIFY implementation. (diff)
downloadrtems-802808900053e732881795d0d748d8fdc2a54e13.tar.bz2
tests: Rework interrupt critical tests
This avoids test durations of more than one hour on fast targets, since fast targets can count a lot during one clock tick period, so the minor loop iteration count was quite high. Estimate now the test body duration to iterate only through the interesting time window. Add and use interrupt_critical_section_test().
Diffstat (limited to 'testsuites/sptests/spintrcritical_support/intrcritical.h')
-rw-r--r--testsuites/sptests/spintrcritical_support/intrcritical.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/testsuites/sptests/spintrcritical_support/intrcritical.h b/testsuites/sptests/spintrcritical_support/intrcritical.h
index 7989b3f7e2..aca1ee0f2c 100644
--- a/testsuites/sptests/spintrcritical_support/intrcritical.h
+++ b/testsuites/sptests/spintrcritical_support/intrcritical.h
@@ -16,7 +16,7 @@
* @param[in] tsr is the optional timer service routine to fire
*/
void interrupt_critical_section_test_support_initialize(
- rtems_timer_service_routine (*tsr)( rtems_id, void * )
+ rtems_timer_service_routine_entry tsr
);
/**
@@ -29,5 +29,24 @@ void interrupt_critical_section_test_support_initialize(
*/
bool interrupt_critical_section_test_support_delay(void);
+/**
+ * @brief Interrupt critical section test.
+ *
+ * This function first estimates the test body duration and then repeatedly
+ * calls the test body with varying times to the next clock tick interrupt.
+ *
+ * @param[in] test_body The test body function. In case the test body returns
+ * true, then the test iteration stops.
+ * @param[in] test_body_arg The argument for the test body function.
+ * @param[in] tsr An optional timer service routine.
+ *
+ * @return The test body return status.
+ */
+bool interrupt_critical_section_test(
+ bool ( *test_body )( void * ),
+ void *test_body_arg,
+ rtems_timer_service_routine_entry tsr
+);
+
#endif