source: rtems/testsuites/itrontests/itrontask04/init.c @ 713b2ea

4.104.114.84.95
Last change on this file since 713b2ea was e099180, checked in by Joel Sherrill <joel.sherrill@…>, on 11/09/99 at 23:27:05

Merged tests from Task group.

  • 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 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 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.OARcorp.com/rtems/license.html.
16 *
17 *  $Id$
18 */
19
20#define TEST_INIT
21#include "system.h"
22#include <stdio.h>
23
24void ITRON_Init( void )
25{
26  ER                status;
27  T_CTSK            pk_ctsk;
28
29  puts( "\n\n*** ITRON TEST 6 ***" );
30
31  status = chg_pri( 0, 20 );
32  directive_failed( status, "chg_pri to 20" );
33
34  pk_ctsk.exinf    = NULL;
35  pk_ctsk.tskatr   = TA_HLNG;
36  pk_ctsk.stksz    = RTEMS_MINIMUM_STACK_SIZE;
37  pk_ctsk.itskpri  = 2;
38
39  pk_ctsk.task     = Task_1;
40  status = cre_tsk( TA1_ID, &pk_ctsk );
41  directive_failed( status, "cre_tsk of TA1" );
42
43  pk_ctsk.task     = Task_2;
44  status = cre_tsk( TA2_ID, &pk_ctsk );
45  directive_failed( status, "cre_tsk of TA2" );
46
47  pk_ctsk.itskpri  = 1;
48  pk_ctsk.task     = Task_3;
49  status = cre_tsk( TA3_ID, &pk_ctsk );
50  directive_failed( status, "cre_tsk of TA3" );
51
52  puts("INIT - dis_dsp while starting tasks");
53  status = dis_dsp( );
54  directive_failed( status, "dis_dsp from ITRON_Init" ); 
55  status  = sta_tsk( TA1_ID, 0 );
56  directive_failed( status, "sta_tsk of TA1" );
57  status  = sta_tsk( TA2_ID, 0 );
58  directive_failed( status, "sta_tsk of TA2" );
59  status  = sta_tsk( TA3_ID, 0 );
60  directive_failed( status, "sta_tsk of TA3" );
61
62  puts( "INIT - suspending TA2 3 times" );
63  status = sus_tsk( TA2_ID  );
64  directive_failed( status, "sus_tsk of TA2" );
65  status = sus_tsk( TA2_ID  );
66  directive_failed( status, "sus_tsk of TA2" );
67  status = sus_tsk( TA2_ID  );
68  directive_failed( status, "sus_tsk of TA2" );
69
70  puts("INIT - ena_dsp while starting tasks");
71  status = ena_dsp( );
72
73  puts( "INIT - suspending TA1 3 times" );
74  status = sus_tsk( TA1_ID  );
75  directive_failed( status, "sus_tsk of TA2" );
76  status = sus_tsk( TA1_ID  );
77  directive_failed( status, "sus_tsk of TA2" );
78  status = sus_tsk( TA1_ID  );
79  directive_failed( status, "sus_tsk of TA2" );
80
81  puts("INIT - exd_tsk");
82  exd_tsk();
83  directive_failed( 0, "exd_tsk" );
84}
85
Note: See TracBrowser for help on using the repository browser.