source: rtems/testsuites/sptests/spintrcritical_support/intrcritical.h @ 8028089

4.115
Last change on this file since 8028089 was 8028089, checked in by Sebastian Huber <sebastian.huber@…>, on 09/08/14 at 13:18:07

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().

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2009.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#ifndef __INTERRUPT_CRITICAL_SECTIONS_TEST_SUPPORT_h
11#define __INTERRUPT_CRITICAL_SECTIONS_TEST_SUPPORT_h
12
13/**
14 *  @brief Initialize Test Support
15 *
16 *  @param[in] tsr is the optional timer service routine to fire
17 */
18void interrupt_critical_section_test_support_initialize(
19  rtems_timer_service_routine_entry tsr
20);
21
22/**
23 *  @brief Delay Test Support
24 *
25 *  This method delays a varying amount of time each call.
26 *
27 *  @return This method returns true each time the delay counter has
28 *          to be reset.
29 */
30bool interrupt_critical_section_test_support_delay(void);
31
32/**
33 * @brief Interrupt critical section test.
34 *
35 * This function first estimates the test body duration and then repeatedly
36 * calls the test body with varying times to the next clock tick interrupt.
37 *
38 * @param[in] test_body The test body function.  In case the test body returns
39 * true, then the test iteration stops.
40 * @param[in] test_body_arg The argument for the test body function.
41 * @param[in] tsr An optional timer service routine.
42 *
43 * @return The test body return status.
44 */
45bool interrupt_critical_section_test(
46  bool                              ( *test_body )( void * ),
47  void                                *test_body_arg,
48  rtems_timer_service_routine_entry    tsr
49);
50
51#endif
52
Note: See TracBrowser for help on using the repository browser.