[352c9b2] | 1 | /* Init |
---|
| 2 | * |
---|
| 3 | * This routine is the initialization task for this test program. |
---|
[e099180] | 4 | * It is called from init_exec and has the responsibility for creating |
---|
[352c9b2] | 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 |
---|
[e099180] | 7 | * value by this function. |
---|
[352c9b2] | 8 | * |
---|
| 9 | * Input parameters: NONE |
---|
| 10 | * |
---|
| 11 | * Output parameters: NONE |
---|
| 12 | * |
---|
[9d9a3dd] | 13 | * COPYRIGHT (c) 1989-1999. |
---|
| 14 | * On-Line Applications Research Corporation (OAR). |
---|
| 15 | * |
---|
[352c9b2] | 16 | * The license and distribution terms for this file may be |
---|
| 17 | * found in the file LICENSE in this distribution or at |
---|
[2f564fee] | 18 | * http://www.rtems.com/license/LICENSE. |
---|
[352c9b2] | 19 | * |
---|
| 20 | * $Id$ |
---|
| 21 | */ |
---|
| 22 | |
---|
[016e1e2] | 23 | #define CONFIGURE_INIT |
---|
[352c9b2] | 24 | #include "system.h" |
---|
[e099180] | 25 | #include <stdio.h> |
---|
[352c9b2] | 26 | |
---|
| 27 | void ITRON_Init( void ) |
---|
| 28 | { |
---|
| 29 | rtems_time_of_day time; |
---|
| 30 | ER status; |
---|
[e099180] | 31 | T_CTSK pk_ctsk; |
---|
[352c9b2] | 32 | |
---|
[3136f5c9] | 33 | puts( "\n\n*** ITRON TASK TEST 1 ***" ); |
---|
[e099180] | 34 | |
---|
| 35 | /* |
---|
| 36 | * XXX - Change this to an itron clock !! |
---|
| 37 | */ |
---|
[352c9b2] | 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 | |
---|
[e099180] | 43 | pk_ctsk.exinf = NULL; |
---|
| 44 | pk_ctsk.tskatr = TA_HLNG; |
---|
[1b4f2b30] | 45 | pk_ctsk.itskpri = 1; |
---|
[e099180] | 46 | pk_ctsk.task = Task_2_through_4; |
---|
[352c9b2] | 47 | |
---|
[1b4f2b30] | 48 | pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 2; |
---|
[e099180] | 49 | status = cre_tsk( 2, &pk_ctsk ); |
---|
[352c9b2] | 50 | directive_failed( status, "cre_tsk of TA1" ); |
---|
| 51 | |
---|
[e099180] | 52 | pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 2; |
---|
| 53 | status = cre_tsk( 3, &pk_ctsk ); |
---|
| 54 | directive_failed( status, "cre_tsk of TA2" ); |
---|
[352c9b2] | 55 | |
---|
[1b4f2b30] | 56 | pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 3; |
---|
[e099180] | 57 | status = cre_tsk( 4, &pk_ctsk ); |
---|
| 58 | directive_failed( status, "cre_tsk of TA3" ); |
---|
[352c9b2] | 59 | |
---|
[e099180] | 60 | status = sta_tsk( 2, 0 ); |
---|
| 61 | directive_failed( status, "sta_tsk of TA1" ); |
---|
[352c9b2] | 62 | |
---|
[e099180] | 63 | status = sta_tsk( 3, 0 ); |
---|
| 64 | directive_failed( status, "sta_tsk of TA1" ); |
---|
[352c9b2] | 65 | |
---|
[e099180] | 66 | status = sta_tsk( 4, 0 ); |
---|
| 67 | directive_failed( status, "sta_tsk of TA1" ); |
---|
[352c9b2] | 68 | |
---|
[e099180] | 69 | exd_tsk(); |
---|
| 70 | directive_failed( 0, "exd_tsk" ); |
---|
[352c9b2] | 71 | } |
---|