source: rtems/testsuites/itrontests/itrontask01/init.c @ 3d54837

4.104.115
Last change on this file since 3d54837 was 016e1e2, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 1, 2008 at 12:45:01 AM

2008-01-31 Joel Sherrill <joel.sherrill@…>

  • itronhello/init.c, itronmbf01/init.c, itronmbox01/init.c, itronsem01/init.c, itrontask01/init.c, itrontask02/init.c, itrontask03/init.c, itrontask04/init.c, itrontime01/init.c: Change TEST_INIT to CONFIGURE_INIT. Make tmacros.h available to all POSIX tests. Add a clock_settime case for < 1988.
  • Property mode set to 100644
File size: 1.8 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 CONFIGURE_INIT
24#include "system.h"
25#include <stdio.h>
26
27void ITRON_Init( void )
28{
29  rtems_time_of_day time;
30  ER                status;
31  T_CTSK            pk_ctsk;
32
33  puts( "\n\n*** ITRON TASK TEST 1 ***" );
34
35  /*
36   * XXX - Change this to an itron clock !!
37   */
38
39  build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
40  status = rtems_clock_set( &time );
41  directive_failed( status, "rtems_clock_set" );
42
43  pk_ctsk.exinf    = NULL;
44  pk_ctsk.tskatr   = TA_HLNG;
45  pk_ctsk.itskpri  = 1;
46  pk_ctsk.task     = Task_2_through_4;
47
48  pk_ctsk.stksz    = RTEMS_MINIMUM_STACK_SIZE * 2;
49  status = cre_tsk( 2, &pk_ctsk );
50  directive_failed( status, "cre_tsk of TA1" );
51
52  pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 2;
53  status = cre_tsk( 3, &pk_ctsk );
54  directive_failed( status, "cre_tsk of TA2" );
55
56  pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 3;
57  status = cre_tsk( 4, &pk_ctsk );
58  directive_failed( status, "cre_tsk of TA3" );
59
60  status  = sta_tsk( 2, 0 );
61  directive_failed( status, "sta_tsk of TA1" );
62
63  status  = sta_tsk( 3, 0 );
64  directive_failed( status, "sta_tsk of TA1" );
65
66  status  = sta_tsk( 4, 0 );
67  directive_failed( status, "sta_tsk of TA1" );
68
69  exd_tsk();
70  directive_failed( 0, "exd_tsk" );
71}
Note: See TracBrowser for help on using the repository browser.