source: rtems/testsuites/sptests/spintrcritical13/init.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 2.7 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.com/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <tmacros.h>
15#include <intrcritical.h>
16
17#if defined(FIRE_AFTER)
18  #define TEST_NAME          "13"
19  #define TEST_STRING        "Timer Fire After"
20  #define TEST_DIRECTIVE     rtems_timer_fire_after
21
22#elif defined(SERVER_FIRE_AFTER)
23  #define TEST_NAME          "14"
24  #define TEST_STRING        "Timer Server Fire After"
25  #define TEST_DIRECTIVE     rtems_timer_server_fire_after
26
27#else
28  #error "Test Mode not defined"
29
30#endif
31
32rtems_id Main_task;
33rtems_id Timer;
34
35rtems_timer_service_routine TimerMethod(
36  rtems_id  timer,
37  void     *arg
38)
39{
40}
41
42rtems_timer_service_routine test_release_from_isr(
43  rtems_id  timer,
44  void     *arg
45)
46{
47  (void) rtems_timer_fire_after( Timer, 10, TimerMethod, NULL );
48}
49
50rtems_task Init(
51  rtems_task_argument ignored
52)
53{
54  rtems_status_code     sc;
55  int                   resets;
56
57  puts( "\n\n*** TEST INTERRUPT CRITICAL SECTION " TEST_NAME " ***" );
58
59  puts( "Init - Trying to generate timer fire from ISR while firing" );
60  puts( "Init - Variation is: " TEST_STRING );
61
62  puts( "Init - There is no way for the test to know if it hits the case" );
63
64  #if defined(SERVER_FIRE_AFTER)
65   /* initiate timer server */
66    sc = rtems_timer_initiate_server(
67      RTEMS_MINIMUM_PRIORITY,
68      RTEMS_MINIMUM_STACK_SIZE,
69      RTEMS_DEFAULT_ATTRIBUTES
70    );
71    directive_failed( sc, "rtems_timer_initiate_server" );
72  #endif
73
74  puts( "Init - rtems_timer_create - OK" );
75  sc = rtems_timer_create( rtems_build_name( 'P', 'E', 'R', '1' ), &Timer);
76  directive_failed( sc, "rtems_timer_create" );
77
78  Main_task = rtems_task_self();
79
80  interrupt_critical_section_test_support_initialize( test_release_from_isr );
81
82  for (resets=0 ; resets<10 ;) {
83    if ( interrupt_critical_section_test_support_delay() )
84      resets++;
85
86    sc = TEST_DIRECTIVE( Timer, 10, TimerMethod, NULL );
87    directive_failed( sc, "rtems_timer_fire_after");
88  }
89
90  puts( "*** END OF TEST INTERRUPT CRITICAL SECTION " TEST_NAME " ***" );
91  rtems_test_exit(0);
92}
93
94/* configuration information */
95
96#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
97#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
98
99#if defined(SERVER_FIRE_AFTER)
100  #define CONFIGURE_MAXIMUM_TASKS     3
101#else
102  #define CONFIGURE_MAXIMUM_TASKS     2
103#endif
104#define CONFIGURE_MAXIMUM_TIMERS      2
105#define CONFIGURE_MICROSECONDS_PER_TICK  1000
106#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
107
108#define CONFIGURE_INIT
109#include <rtems/confdefs.h>
110
111/* global variables */
Note: See TracBrowser for help on using the repository browser.