source: rtems/testsuites/sptests/sp06/init.c @ 4b374f36

4.104.114.84.95
Last change on this file since 4b374f36 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/11/95 at 17:39:37

Initial revision

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*  Init
2 *
3 *  This routine is the initialization task for this test program.
4 *  It is a user initialization task 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:
10 *    argument - task argument
11 *
12 *  Output parameters:  NONE
13 *
14 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
15 *  On-Line Applications Research Corporation (OAR).
16 *  All rights assigned to U.S. Government, 1994.
17 *
18 *  This material may be reproduced by or for the U.S. Government pursuant
19 *  to the copyright license under the clause at DFARS 252.227-7013.  This
20 *  notice must appear in all copies of this file and its derivatives.
21 *
22 *  $Id$
23 */
24
25#include "system.h"
26#undef EXTERN
27#define EXTERN
28#include "conftbl.h"
29#include "gvar.h"
30
31rtems_task Init(
32  rtems_task_argument argument
33)
34{
35  rtems_status_code   status;
36  rtems_task_priority previous_priority;
37
38  puts( "\n\n*** TEST 6 ***" );
39
40  Task_name[ 1 ] =  rtems_build_name( 'T', 'A', '1', ' ' );
41  Task_name[ 2 ] =  rtems_build_name( 'T', 'A', '2', ' ' );
42  Task_name[ 3 ] =  rtems_build_name( 'T', 'A', '3', ' ' );
43
44  Argument = 0;
45  Restart_argument = 1;
46
47  status = rtems_task_create(
48     Task_name[ 1 ],
49     1,
50     2048,
51     RTEMS_DEFAULT_MODES,
52     RTEMS_DEFAULT_ATTRIBUTES,
53     &Task_id[ 1 ]
54  );
55  directive_failed( status, "rtems_task_create of TA1" );
56
57  status = rtems_task_create(
58     Task_name[ 2 ],
59     1,
60     2048,
61     RTEMS_DEFAULT_MODES,
62     RTEMS_DEFAULT_ATTRIBUTES,
63     &Task_id[ 2 ]
64  );
65  directive_failed( status, "rtems_task_create of TA2" );
66
67  status = rtems_task_create(
68     Task_name[ 3 ],
69     10,
70     2048,
71     RTEMS_DEFAULT_MODES,
72     RTEMS_DEFAULT_ATTRIBUTES,
73     &Task_id[ 3 ]
74  );
75  directive_failed( status, "rtems_task_create of TA3" );
76
77  status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
78  directive_failed( status, "rtems_task_start of TA1" );
79
80  status = rtems_task_start( Task_id[ 2 ], Task_2, Argument );
81  directive_failed( status, "rtems_task_start of TA2" );
82
83  status = rtems_task_start( Task_id[ 3 ], Task_3, Argument );
84  directive_failed( status, "rtems_task_start of TA3" );
85
86  status = rtems_task_set_priority( Task_id[ 3 ], 5, &previous_priority );
87
88  status = rtems_task_delete( RTEMS_SELF );
89  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
90}
Note: See TracBrowser for help on using the repository browser.