source: rtems/testsuites/sptests/sp04/init.c @ 3652ad35

4.104.114.84.95
Last change on this file since 3652ad35 was 3652ad35, checked in by Joel Sherrill <joel.sherrill@…>, on 09/19/95 at 14:53:29

Minor bug fixes to get all targets compilable and running. The
single biggest changes were the expansion of the workspace size
macro to include other types of objects and the increase in the
minimum stack size for most CPUs.

  • Property mode set to 100644
File size: 3.3 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#define TEST_INIT
26#include "system.h"
27
28rtems_extensions_table Extensions = {
29  NULL,                      /* task create user extension */
30  NULL,                      /* task start user extension */
31  NULL,                      /* task restart user extension */
32  NULL,                      /* task delete user extension */
33  Task_switch,               /* task switch user extension */
34  NULL,                      /* task post switch user extension */
35  NULL,                      /* task begin user extension */
36  NULL,                      /* task exitted user extension */
37  NULL                       /* fatal error user extension */
38};
39
40rtems_task Init(
41  rtems_task_argument argument
42)
43{
44  rtems_status_code status;
45  rtems_time_of_day time;
46
47  puts( "\n\n*** TEST 4 ***" );
48  build_time( &time, 12, 31, 1988, 9, 15, 0, 0 );
49
50  status = rtems_clock_set( &time );
51  directive_failed( status, "rtems_clock_set" );
52
53  Extension_name[ 1 ] =  rtems_build_name( 'E', 'X', 'T', ' ' );
54
55  status = rtems_extension_create(
56    Extension_name[ 1 ],
57    &Extensions,
58    &Extension_id[ 1 ]
59  );
60  directive_failed( status, "rtems_extension_create" );
61
62  Task_name[ 1 ] =  rtems_build_name( 'T', 'A', '1', ' ' );
63  Task_name[ 2 ] =  rtems_build_name( 'T', 'A', '2', ' ' );
64  Task_name[ 3 ] =  rtems_build_name( 'T', 'A', '3', ' ' );
65
66  Run_count[ 1 ] = 0;
67  Run_count[ 2 ] = 0;
68  Run_count[ 3 ] = 0;
69
70  status = rtems_task_create(
71     Task_name[ 1 ],
72     1,
73     RTEMS_MINIMUM_STACK_SIZE * 2,
74     RTEMS_TIMESLICE,
75     RTEMS_DEFAULT_ATTRIBUTES,
76     &Task_id[ 1 ]
77  );
78  directive_failed( status, "rtems_task_create of TA1" );
79
80  status = rtems_task_create(
81     Task_name[ 2 ],
82     1,
83     RTEMS_MINIMUM_STACK_SIZE * 2,
84     RTEMS_TIMESLICE,
85     RTEMS_DEFAULT_ATTRIBUTES,
86     &Task_id[ 2 ]
87  );
88  directive_failed( status, "rtems_task_create of TA2" );
89
90  status = rtems_task_create(
91     Task_name[ 3 ],
92     1,
93     RTEMS_MINIMUM_STACK_SIZE * 2,
94     RTEMS_TIMESLICE,
95     RTEMS_DEFAULT_ATTRIBUTES,
96     &Task_id[ 3 ]
97  );
98  directive_failed( status, "rtems_task_create of TA3" );
99
100  status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
101  directive_failed( status, "rtems_task_start of TA1" );
102
103  status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
104  directive_failed( status, "rtems_task_start of TA2" );
105
106  status = rtems_task_start( Task_id[ 3 ], Task_3, 0 );
107  directive_failed( status, "rtems_task_start of TA3" );
108
109  status = rtems_task_delete( RTEMS_SELF );
110  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
111}
Note: See TracBrowser for help on using the repository browser.