source: rtems/testsuites/itrontests/itrontask04/init.c @ 11ef7b6

4.104.115
Last change on this file since 11ef7b6 was 11ef7b6, checked in by Joel Sherrill <joel.sherrill@…>, on 12/14/08 at 18:39:44

2008-12-14 Joel Sherrill <joel.sherrill@…>

  • itrontask04/init.c: Run all tests successfully with maxixum number of priorities as 16 instead of 256. This was done by temporarily modifying the score priority.h maximum. This allowed testing of all API code to ensure that it worked properly with a reduced number of priorities. Most modifications were to switch from hard-coded maximum to using the API provided methods to determine maximum number of priority levels.
  • Property mode set to 100644
File size: 2.7 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-2008.
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 CONFIGURE_INIT
24#include "system.h"
25#include <stdio.h>
26
27#include <rtems.h>
28
29void ITRON_Init( void )
30{
31  ER                status;
32  T_CTSK            pk_ctsk;
33
34  puts( "\n\n*** ITRON TASK TEST 4 ***" );
35
36  status = chg_pri( 0, RTEMS_MAXIMUM_PRIORITY - 2 );
37  directive_failed( status, "chg_pri to MAX - 2" );
38
39  pk_ctsk.exinf    = NULL;
40  pk_ctsk.tskatr   = TA_HLNG;
41  pk_ctsk.stksz    = RTEMS_MINIMUM_STACK_SIZE;
42  pk_ctsk.itskpri  = 2;
43
44  pk_ctsk.task     = Task_1;
45  status = cre_tsk( TA1_ID, &pk_ctsk );
46  directive_failed( status, "cre_tsk of TA1" );
47
48  pk_ctsk.task     = Task_2;
49  status = cre_tsk( TA2_ID, &pk_ctsk );
50  directive_failed( status, "cre_tsk of TA2" );
51
52  pk_ctsk.itskpri  = 1;
53  pk_ctsk.task     = Task_3;
54  status = cre_tsk( TA3_ID, &pk_ctsk );
55  directive_failed( status, "cre_tsk of TA3" );
56
57  puts("INIT - dis_dsp while starting tasks");
58  status = dis_dsp( );
59
60  /* dispatching disabled -- NOT LEGAL TO PRINT UNTIL ENABLED */
61
62  directive_failed_with_level( status, "dis_dsp from ITRON_Init", 1 );
63  status  = sta_tsk( TA1_ID, 0 );
64  directive_failed_with_level( status, "sta_tsk of TA1", 1 );
65  status  = sta_tsk( TA2_ID, 0 );
66  directive_failed_with_level( status, "sta_tsk of TA2", 1 );
67  status  = sta_tsk( TA3_ID, 0 );
68  directive_failed_with_level( status, "sta_tsk of TA3", 1 );
69
70  /* puts( "INIT - suspending TA2 3 times" ); */
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  status = sus_tsk( TA2_ID  );
76  directive_failed_with_level( status, "sus_tsk of TA2", 1 );
77
78  status = ena_dsp( );
79
80  /* dispatching enabled -- LEGAL TO PRINT AGAIN */
81
82  puts("INIT - ena_dsp after starting tasks");
83
84  puts( "INIT - suspending TA1 3 times" );
85  status = sus_tsk( TA1_ID  );
86  directive_failed( status, "sus_tsk of TA2" );
87  status = sus_tsk( TA1_ID  );
88  directive_failed( status, "sus_tsk of TA2" );
89  status = sus_tsk( TA1_ID  );
90  directive_failed( status, "sus_tsk of TA2" );
91
92  puts("INIT - exd_tsk");
93  exd_tsk();
94  directive_failed( 0, "exd_tsk" );
95}
Note: See TracBrowser for help on using the repository browser.