| 1 |
30 |
unneback |
/* Init
|
| 2 |
|
|
*
|
| 3 |
|
|
* This routine is the initialization task for this test program.
|
| 4 |
|
|
* It is a user initialization task 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:
|
| 10 |
|
|
* argument - task argument
|
| 11 |
|
|
*
|
| 12 |
|
|
* Output parameters: NONE
|
| 13 |
|
|
*
|
| 14 |
|
|
* COPYRIGHT (c) 1989-1999.
|
| 15 |
|
|
* On-Line Applications Research Corporation (OAR).
|
| 16 |
|
|
*
|
| 17 |
|
|
* The license and distribution terms for this file may be
|
| 18 |
|
|
* found in the file LICENSE in this distribution or at
|
| 19 |
|
|
* http://www.OARcorp.com/rtems/license.html.
|
| 20 |
|
|
*
|
| 21 |
|
|
* $Id: init.c,v 1.2 2001-09-27 12:02:31 chris Exp $
|
| 22 |
|
|
*/
|
| 23 |
|
|
|
| 24 |
|
|
#define TEST_INIT
|
| 25 |
|
|
#include "system.h"
|
| 26 |
|
|
|
| 27 |
|
|
rtems_task Init(
|
| 28 |
|
|
rtems_task_argument argument
|
| 29 |
|
|
)
|
| 30 |
|
|
{
|
| 31 |
|
|
rtems_status_code status;
|
| 32 |
|
|
|
| 33 |
|
|
puts( "\n\n*** TEST 9 ***" );
|
| 34 |
|
|
|
| 35 |
|
|
Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
|
| 36 |
|
|
Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
|
| 37 |
|
|
Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
|
| 38 |
|
|
Task_name[ 4 ] = rtems_build_name( 'T', 'A', '4', ' ' );
|
| 39 |
|
|
Task_name[ 5 ] = rtems_build_name( 'T', 'A', '5', ' ' );
|
| 40 |
|
|
Task_name[ 6 ] = rtems_build_name( 'T', 'A', '6', ' ' );
|
| 41 |
|
|
Task_name[ 7 ] = rtems_build_name( 'T', 'A', '7', ' ' );
|
| 42 |
|
|
Task_name[ 8 ] = rtems_build_name( 'T', 'A', '8', ' ' );
|
| 43 |
|
|
Task_name[ 9 ] = rtems_build_name( 'T', 'A', '9', ' ' );
|
| 44 |
|
|
Task_name[ 10 ] = rtems_build_name( 'T', 'A', 'A', ' ' );
|
| 45 |
|
|
|
| 46 |
|
|
Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' );
|
| 47 |
|
|
|
| 48 |
|
|
Semaphore_name[ 1 ] = rtems_build_name( 'S', 'M', '1', ' ' );
|
| 49 |
|
|
Semaphore_name[ 2 ] = rtems_build_name( 'S', 'M', '2', ' ' );
|
| 50 |
|
|
Semaphore_name[ 3 ] = rtems_build_name( 'S', 'M', '3', ' ' );
|
| 51 |
|
|
|
| 52 |
|
|
Queue_name[ 1 ] = rtems_build_name( 'M', 'Q', '1', ' ' );
|
| 53 |
|
|
Queue_name[ 2 ] = rtems_build_name( 'M', 'Q', '2', ' ' );
|
| 54 |
|
|
|
| 55 |
|
|
Partition_name[ 1 ] = rtems_build_name( 'P', 'T', '1', ' ' );
|
| 56 |
|
|
|
| 57 |
|
|
Region_name[ 1 ] = rtems_build_name( 'R', 'N', '1', ' ' );
|
| 58 |
|
|
|
| 59 |
|
|
Port_name[ 1 ] = rtems_build_name( 'D', 'P', '1', ' ' );
|
| 60 |
|
|
|
| 61 |
|
|
Period_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' );
|
| 62 |
|
|
|
| 63 |
|
|
#if 0
|
| 64 |
|
|
status = rtems_task_create(
|
| 65 |
|
|
Task_name[1],
|
| 66 |
|
|
4,
|
| 67 |
|
|
10,
|
| 68 |
|
|
RTEMS_DEFAULT_MODES,
|
| 69 |
|
|
RTEMS_DEFAULT_ATTRIBUTES,
|
| 70 |
|
|
&Task_id[ 1 ]
|
| 71 |
|
|
);
|
| 72 |
|
|
fatal_directive_status(
|
| 73 |
|
|
status,
|
| 74 |
|
|
RTEMS_INVALID_SIZE,
|
| 75 |
|
|
"rtems_task_create with illegal stack size"
|
| 76 |
|
|
);
|
| 77 |
|
|
puts( "INIT - rtems_task_create - RTEMS_INVALID_SIZE" );
|
| 78 |
|
|
#endif
|
| 79 |
|
|
puts( "INIT - rtems_task_create - RTEMS_INVALID_SIZE -- NOT CHECKED" );
|
| 80 |
|
|
|
| 81 |
|
|
status = rtems_task_create(
|
| 82 |
|
|
Task_name[1],
|
| 83 |
|
|
0,
|
| 84 |
|
|
RTEMS_MINIMUM_STACK_SIZE,
|
| 85 |
|
|
RTEMS_DEFAULT_MODES,
|
| 86 |
|
|
RTEMS_DEFAULT_ATTRIBUTES,
|
| 87 |
|
|
&Task_id[ 1 ]
|
| 88 |
|
|
);
|
| 89 |
|
|
fatal_directive_status(
|
| 90 |
|
|
status,
|
| 91 |
|
|
RTEMS_INVALID_PRIORITY,
|
| 92 |
|
|
"rtems_task_create with illegal priority"
|
| 93 |
|
|
);
|
| 94 |
|
|
puts( "INIT - rtems_task_create - RTEMS_INVALID_PRIORITY" );
|
| 95 |
|
|
|
| 96 |
|
|
status = rtems_task_create(
|
| 97 |
|
|
Task_name[ 1 ],
|
| 98 |
|
|
4,
|
| 99 |
|
|
RTEMS_MINIMUM_STACK_SIZE * 3,
|
| 100 |
|
|
RTEMS_DEFAULT_MODES,
|
| 101 |
|
|
RTEMS_DEFAULT_ATTRIBUTES,
|
| 102 |
|
|
&Task_id[ 1 ]
|
| 103 |
|
|
);
|
| 104 |
|
|
directive_failed( status, "rtems_task_create of TA1" );
|
| 105 |
|
|
|
| 106 |
|
|
status = rtems_task_restart( Task_id[ 1 ], 0 );
|
| 107 |
|
|
fatal_directive_status(
|
| 108 |
|
|
status,
|
| 109 |
|
|
RTEMS_INCORRECT_STATE,
|
| 110 |
|
|
"rtems_task_restart of DORMANT task"
|
| 111 |
|
|
);
|
| 112 |
|
|
puts( "INIT - rtems_task_restart - RTEMS_INCORRECT_STATE" );
|
| 113 |
|
|
|
| 114 |
|
|
status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
|
| 115 |
|
|
directive_failed( status, "rtems_task_start of TA1" );
|
| 116 |
|
|
|
| 117 |
|
|
status = rtems_task_delete( RTEMS_SELF );
|
| 118 |
|
|
directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
|
| 119 |
|
|
}
|