[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 | * |
---|
| 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" |
---|
[e099180] | 22 | #include <stdio.h> |
---|
[352c9b2] | 23 | |
---|
| 24 | void ITRON_Init( void ) |
---|
| 25 | { |
---|
| 26 | rtems_time_of_day time; |
---|
| 27 | ER status; |
---|
[e099180] | 28 | T_CTSK pk_ctsk; |
---|
[352c9b2] | 29 | |
---|
[e099180] | 30 | puts( "\n\n*** ITRON TEST 3 ***" ); |
---|
| 31 | |
---|
| 32 | /* |
---|
| 33 | * XXX - Change this to an itron clock !! |
---|
| 34 | */ |
---|
[352c9b2] | 35 | |
---|
| 36 | build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); |
---|
| 37 | status = rtems_clock_set( &time ); |
---|
| 38 | directive_failed( status, "rtems_clock_set" ); |
---|
| 39 | |
---|
[e099180] | 40 | pk_ctsk.exinf = NULL; |
---|
| 41 | pk_ctsk.tskatr = TA_HLNG; |
---|
| 42 | pk_ctsk.itskpri = 1; |
---|
| 43 | pk_ctsk.task = Task_2_through_4; |
---|
[352c9b2] | 44 | |
---|
[e099180] | 45 | pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE; |
---|
| 46 | status = cre_tsk( 2, &pk_ctsk ); |
---|
[352c9b2] | 47 | directive_failed( status, "cre_tsk of TA1" ); |
---|
| 48 | |
---|
[e099180] | 49 | pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 2; |
---|
| 50 | status = cre_tsk( 3, &pk_ctsk ); |
---|
| 51 | directive_failed( status, "cre_tsk of TA2" ); |
---|
[352c9b2] | 52 | |
---|
[e099180] | 53 | pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 3; |
---|
| 54 | status = cre_tsk( 4, &pk_ctsk ); |
---|
| 55 | directive_failed( status, "cre_tsk of TA3" ); |
---|
[352c9b2] | 56 | |
---|
[e099180] | 57 | status = sta_tsk( 2, 0 ); |
---|
| 58 | directive_failed( status, "sta_tsk of TA1" ); |
---|
[352c9b2] | 59 | |
---|
[e099180] | 60 | status = sta_tsk( 3, 0 ); |
---|
| 61 | directive_failed( status, "sta_tsk of TA1" ); |
---|
[352c9b2] | 62 | |
---|
[e099180] | 63 | status = sta_tsk( 4, 0 ); |
---|
| 64 | directive_failed( status, "sta_tsk of TA1" ); |
---|
[352c9b2] | 65 | |
---|
[e099180] | 66 | exd_tsk(); |
---|
| 67 | directive_failed( 0, "exd_tsk" ); |
---|
[352c9b2] | 68 | } |
---|