source: rtems/c/src/tests/itrontests/itrontask04/init.c @ e672263

4.104.114.84.95
Last change on this file since e672263 was e672263, checked in by Jennifer Averett <Jennifer.Averett@…>, on 11/15/99 at 21:28:21

Fixed verificaiton checks to call correct macro if dispatch is disabled.

  • Property mode set to 100644
File size: 2.5 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 TASK TEST 4 ***" );
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
55  /* dispatching disabled */
56
57  directive_failed_with_level( status, "dis_dsp from ITRON_Init", 1 ); 
58  status  = sta_tsk( TA1_ID, 0 );
59  directive_failed_with_level( status, "sta_tsk of TA1", 1 );
60  status  = sta_tsk( TA2_ID, 0 );
61  directive_failed_with_level( status, "sta_tsk of TA2", 1 );
62  status  = sta_tsk( TA3_ID, 0 );
63  directive_failed_with_level( status, "sta_tsk of TA3", 1 );
64
65  puts( "INIT - suspending TA2 3 times" );
66  status = sus_tsk( TA2_ID  );
67  directive_failed_with_level( status, "sus_tsk of TA2", 1 );
68  status = sus_tsk( TA2_ID  );
69  directive_failed_with_level( status, "sus_tsk of TA2", 1 );
70  status = sus_tsk( TA2_ID  );
71  directive_failed_with_level( status, "sus_tsk of TA2", 1 );
72
73  puts("INIT - ena_dsp while starting tasks");
74  status = ena_dsp( );
75
76  /* dispatching enabled again */
77
78  puts( "INIT - suspending TA1 3 times" );
79  status = sus_tsk( TA1_ID  );
80  directive_failed( status, "sus_tsk of TA2" );
81  status = sus_tsk( TA1_ID  );
82  directive_failed( status, "sus_tsk of TA2" );
83  status = sus_tsk( TA1_ID  );
84  directive_failed( status, "sus_tsk of TA2" );
85
86  puts("INIT - exd_tsk");
87  exd_tsk();
88  directive_failed( 0, "exd_tsk" );
89}
90
Note: See TracBrowser for help on using the repository browser.