source: rtems/testsuites/itrontests/itrontask04/init.c @ 78ef0dc

4.104.114.84.95
Last change on this file since 78ef0dc was 2f564fee, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:53:25

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

  • itronhello/init.c, itronhello/itronhello.doc, itronhello/system.h, itronmbf01/init.c, itronmbf01/itronmbf01.doc, itronmbf01/system.h, itronmbox01/init.c, itronmbox01/system.h, itronsem01/init.c, itronsem01/itronsem01.doc, itronsem01/system.h, itrontask01/init.c, itrontask01/itrontask01.doc, itrontask01/system.h, itrontask01/task1.c, itrontask02/dormant.c, itrontask02/init.c, itrontask02/itrontask02.doc, itrontask02/system.h, itrontask03/init.c, itrontask03/itrontask03.doc, itrontask03/preempt.c, itrontask03/system.h, itrontask03/task1.c, itrontask03/task2.c, itrontask03/task3.c, itrontask04/init.c, itrontask04/itrontask04.doc, itrontask04/system.h, itrontask04/task1.c, itrontask04/task2.c, itrontask04/task3.c, itrontime01/init.c, itrontime01/system.h: URL for license changed.
  • Property mode set to 100644
File size: 2.6 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 TEST_INIT
24#include "system.h"
25#include <stdio.h>
26
27void ITRON_Init( void )
28{
29  ER                status;
30  T_CTSK            pk_ctsk;
31
32  puts( "\n\n*** ITRON TASK TEST 4 ***" );
33
34  status = chg_pri( 0, 20 );
35  directive_failed( status, "chg_pri to 20" );
36
37  pk_ctsk.exinf    = NULL;
38  pk_ctsk.tskatr   = TA_HLNG;
39  pk_ctsk.stksz    = RTEMS_MINIMUM_STACK_SIZE;
40  pk_ctsk.itskpri  = 2;
41
42  pk_ctsk.task     = Task_1;
43  status = cre_tsk( TA1_ID, &pk_ctsk );
44  directive_failed( status, "cre_tsk of TA1" );
45
46  pk_ctsk.task     = Task_2;
47  status = cre_tsk( TA2_ID, &pk_ctsk );
48  directive_failed( status, "cre_tsk of TA2" );
49
50  pk_ctsk.itskpri  = 1;
51  pk_ctsk.task     = Task_3;
52  status = cre_tsk( TA3_ID, &pk_ctsk );
53  directive_failed( status, "cre_tsk of TA3" );
54
55  puts("INIT - dis_dsp while starting tasks");
56  status = dis_dsp( );
57
58  /* dispatching disabled */
59
60  directive_failed_with_level( status, "dis_dsp from ITRON_Init", 1 ); 
61  status  = sta_tsk( TA1_ID, 0 );
62  directive_failed_with_level( status, "sta_tsk of TA1", 1 );
63  status  = sta_tsk( TA2_ID, 0 );
64  directive_failed_with_level( status, "sta_tsk of TA2", 1 );
65  status  = sta_tsk( TA3_ID, 0 );
66  directive_failed_with_level( status, "sta_tsk of TA3", 1 );
67
68  puts( "INIT - suspending TA2 3 times" );
69  status = sus_tsk( TA2_ID  );
70  directive_failed_with_level( status, "sus_tsk of TA2", 1 );
71  status = sus_tsk( TA2_ID  );
72  directive_failed_with_level( status, "sus_tsk of TA2", 1 );
73  status = sus_tsk( TA2_ID  );
74  directive_failed_with_level( status, "sus_tsk of TA2", 1 );
75
76  puts("INIT - ena_dsp while starting tasks");
77  status = ena_dsp( );
78
79  /* dispatching enabled again */
80
81  puts( "INIT - suspending TA1 3 times" );
82  status = sus_tsk( TA1_ID  );
83  directive_failed( status, "sus_tsk of TA2" );
84  status = sus_tsk( TA1_ID  );
85  directive_failed( status, "sus_tsk of TA2" );
86  status = sus_tsk( TA1_ID  );
87  directive_failed( status, "sus_tsk of TA2" );
88
89  puts("INIT - exd_tsk");
90  exd_tsk();
91  directive_failed( 0, "exd_tsk" );
92}
93
Note: See TracBrowser for help on using the repository browser.