source: rtems/c/src/tests/samples/ticker/init.c @ 3e26377b

4.104.114.84.95
Last change on this file since 3e26377b was 3e26377b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:53:41

2003-09-04 Joel Sherrill <joel@…>

  • README, base_mp/apptask.c, base_mp/init.c, base_mp/system.h, base_mp/node1/base_mp.doc, base_mp/node2/base_mp.doc, base_sp/apptask.c, base_sp/base_sp.doc, base_sp/init.c, base_sp/system.h, cdtest/init.c, cdtest/main.cc, cdtest/system.h, fileio/fileio.doc, fileio/init.c, fileio/system.h, hello/hello.doc, hello/init.c, hello/system.h, minimum/init.c, minimum/minimum.doc, paranoia/init.c, paranoia/paranoia.doc, paranoia/system.h, ticker/init.c, ticker/system.h, ticker/tasks.c, ticker/ticker.doc, unlimited/init.c, unlimited/system.h, unlimited/test1.c, unlimited/test2.c, unlimited/test3.c, unlimited/unlimited.doc: URL for license changed.
  • Property mode set to 100644
File size: 2.0 KB
Line 
1/*  Init
2 *
3 *  This routine is the initialization task for this test program.
4 *  It is called from init_exec and has the responsibility for creating
5 *  and starting the tasks that make up the test.  If the time of day
6 *  clock is required for the test, it should also be set to a known
7 *  value by this function.
8 *
9 *  Input parameters:  NONE
10 *
11 *  Output parameters:  NONE
12 *
13 *  COPYRIGHT (c) 1989-1999.
14 *  On-Line Applications Research Corporation (OAR).
15 *
16 *  The license and distribution terms for this file may be
17 *  found in the file LICENSE in this distribution or at
18 *  http://www.rtems.com/license/LICENSE.
19 *
20 *  $Id$
21 */
22
23#define CONFIGURE_INIT
24#include "system.h"
25#include <stdio.h>
26
27/*
28 *  Keep the names and IDs in global variables so another task can use them.
29 */
30
31rtems_id   Task_id[ 4 ];         /* array of task ids */
32rtems_name Task_name[ 4 ];       /* array of task names */
33
34rtems_task Init(
35  rtems_task_argument argument
36)
37{
38  rtems_status_code status;
39  rtems_time_of_day time;
40
41  puts( "\n\n*** CLOCK TICK TEST ***" );
42
43  time.year   = 1988;
44  time.month  = 12;
45  time.day    = 31;
46  time.hour   = 9;
47  time.minute = 0;
48  time.second = 0;
49  time.ticks  = 0;
50
51  status = rtems_clock_set( &time );
52
53  Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
54  Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
55  Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
56
57  status = rtems_task_create(
58    Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
59    RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]
60  );
61  status = rtems_task_create(
62    Task_name[ 2 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
63    RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 2 ]
64  );
65  status = rtems_task_create(
66    Task_name[ 3 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
67    RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 3 ]
68  );
69
70  status = rtems_task_start( Task_id[ 1 ], Test_task, 1 );
71  status = rtems_task_start( Task_id[ 2 ], Test_task, 2 );
72  status = rtems_task_start( Task_id[ 3 ], Test_task, 3 );
73
74  status = rtems_task_delete( RTEMS_SELF );
75}
Note: See TracBrowser for help on using the repository browser.