source: rtems/testsuites/sptests/spsimplesched01/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: 3.7 KB
Line 
1/*
2 *  COPYRIGHT (c) 2011.
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
16/*
17 *  Keep the names and IDs in global variables so another task can use them.
18 */
19rtems_id   Task_id[ 4 ];         /* array of task ids */
20rtems_name Task_name[ 4 ];       /* array of task names */
21
22rtems_task Test_task(
23  rtems_task_argument unused
24)
25{
26  rtems_id           tid;
27  rtems_time_of_day  time;
28  uint32_t           task_index;
29  rtems_status_code  status;
30
31  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
32  directive_failed( status, "task ident" );
33
34  task_index = task_number( tid );
35  for ( ; ; ) {
36    status = rtems_clock_get_tod( &time );
37    directive_failed( status, "clock get tod" );
38    if ( time.second >= 35 ) {
39      puts( "*** END OF SIMPLE01 TEST ***" );
40      rtems_test_exit( 0 );
41    }
42    put_name( Task_name[ task_index ], FALSE );
43    print_time( " - rtems_clock_get_tod - ", &time, "\n" );
44    status = rtems_task_wake_after(
45      task_index * 5 * rtems_clock_get_ticks_per_second()
46    );
47    directive_failed( status, "wake after" );
48  }
49}
50
51rtems_task Init(
52  rtems_task_argument argument
53)
54{
55  rtems_status_code   status;
56  rtems_time_of_day   time;
57  rtems_task_priority old;
58
59  puts( "\n\n*** SIMPLE01 TEST ***" );
60
61  time.year   = 1988;
62  time.month  = 12;
63  time.day    = 31;
64  time.hour   = 9;
65  time.minute = 0;
66  time.second = 0;
67  time.ticks  = 0;
68
69  status = rtems_clock_set( &time );
70
71  Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
72  Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
73  Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
74
75  status = rtems_task_create(
76    Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
77    RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]
78  );
79  directive_failed( status, "create 1" );
80
81  status = rtems_task_create(
82    Task_name[ 2 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
83    RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 2 ]
84  );
85  directive_failed( status, "create 2" );
86
87  status = rtems_task_create(
88    Task_name[ 3 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
89    RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 3 ]
90  );
91  directive_failed( status, "create 3" );
92
93  status = rtems_task_start( Task_id[ 1 ], Test_task, 1 );
94  directive_failed( status, "start 1" );
95  rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
96
97  status = rtems_task_start( Task_id[ 2 ], Test_task, 2 );
98  directive_failed( status, "start 2" );
99  rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
100
101  status = rtems_task_start( Task_id[ 3 ], Test_task, 3 );
102  directive_failed( status, "start 3" );
103
104  status = rtems_task_set_priority( Task_id[1], 2, &old );
105  directive_failed( status, "set priority 1" );
106  status = rtems_task_set_priority( Task_id[2], 2, &old );
107  directive_failed( status, "set priority 2" );
108  status = rtems_task_set_priority( Task_id[3], 2, &old );
109  directive_failed( status, "set priority 3" );
110
111  status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
112  directive_failed( status, "yield" );
113
114  status = rtems_task_delete( RTEMS_SELF );
115  directive_failed( status, "delete self" );
116}
117
118/* configuration information */
119#include <bsp.h> /* for device driver prototypes */
120
121#define CONFIGURE_SCHEDULER_SIMPLE
122#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
123#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
124
125#define CONFIGURE_MAXIMUM_TASKS             4
126
127#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
128
129#define CONFIGURE_EXTRA_TASK_STACKS         (3 * RTEMS_MINIMUM_STACK_SIZE)
130
131#define CONFIGURE_INIT
132#include <rtems/confdefs.h>
133/* end of file */
Note: See TracBrowser for help on using the repository browser.