[ac7d5ef0] | 1 | /* 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 | * |
---|
[08311cc3] | 14 | * COPYRIGHT (c) 1989-1999. |
---|
[ac7d5ef0] | 15 | * On-Line Applications Research Corporation (OAR). |
---|
| 16 | * |
---|
[98e4ebf5] | 17 | * The license and distribution terms for this file may be |
---|
| 18 | * found in the file LICENSE in this distribution or at |
---|
[c499856] | 19 | * http://www.rtems.org/license/LICENSE. |
---|
[ac7d5ef0] | 20 | */ |
---|
| 21 | |
---|
[7d3f9c6] | 22 | #ifdef HAVE_CONFIG_H |
---|
| 23 | #include "config.h" |
---|
| 24 | #endif |
---|
| 25 | |
---|
[2186ba80] | 26 | #define CONFIGURE_INIT |
---|
[ac7d5ef0] | 27 | #include "system.h" |
---|
| 28 | |
---|
[6c0301d] | 29 | const char rtems_test_name[] = "SP 20"; |
---|
| 30 | |
---|
[3d9fd2ce] | 31 | #define BUFFER_COUNT 20 |
---|
| 32 | |
---|
| 33 | #define BUFFER_SIZE 100 |
---|
| 34 | |
---|
| 35 | static rtems_printer_task_context printer_task; |
---|
| 36 | |
---|
| 37 | static long buffers[ BUFFER_COUNT ][ BUFFER_SIZE / sizeof(long) ]; |
---|
| 38 | |
---|
| 39 | void end_of_test( void ) |
---|
| 40 | { |
---|
| 41 | rtems_test_printf( TEST_END_STRING ); |
---|
| 42 | rtems_printer_task_drain( &printer_task ); |
---|
| 43 | rtems_test_exit( 0 ); |
---|
| 44 | } |
---|
| 45 | |
---|
[ac7d5ef0] | 46 | rtems_task Init( |
---|
| 47 | rtems_task_argument argument |
---|
| 48 | ) |
---|
| 49 | { |
---|
[3d9fd2ce] | 50 | int error; |
---|
| 51 | uint32_t index; |
---|
[ac7d5ef0] | 52 | rtems_status_code status; |
---|
| 53 | |
---|
[3d9fd2ce] | 54 | rtems_printer_task_set_priority( &printer_task, 254 ); |
---|
| 55 | rtems_printer_task_set_file_descriptor( &printer_task, 1 ); |
---|
| 56 | rtems_printer_task_set_buffer_table( &printer_task, &buffers[ 0 ][ 0 ] ); |
---|
| 57 | rtems_printer_task_set_buffer_count( &printer_task, BUFFER_COUNT ); |
---|
| 58 | rtems_printer_task_set_buffer_size( &printer_task, BUFFER_SIZE ); |
---|
| 59 | error = rtems_print_printer_task( &rtems_test_printer, &printer_task ); |
---|
| 60 | rtems_test_assert( error == 0 ); |
---|
| 61 | |
---|
| 62 | rtems_test_printf( TEST_BEGIN_STRING ); |
---|
[ac7d5ef0] | 63 | |
---|
| 64 | Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); |
---|
| 65 | Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); |
---|
| 66 | Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' ); |
---|
| 67 | Task_name[ 4 ] = rtems_build_name( 'T', 'A', '4', ' ' ); |
---|
| 68 | Task_name[ 5 ] = rtems_build_name( 'T', 'A', '5', ' ' ); |
---|
[cf42c54c] | 69 | Task_name[ 6 ] = rtems_build_name( 'T', 'A', '6', ' ' ); |
---|
[ac7d5ef0] | 70 | |
---|
[cf42c54c] | 71 | for ( index = 1 ; index <= 6 ; index++ ) { |
---|
[ac7d5ef0] | 72 | status = rtems_task_create( |
---|
| 73 | Task_name[ index ], |
---|
| 74 | Priorities[ index ], |
---|
[6849e53] | 75 | RTEMS_MINIMUM_STACK_SIZE, |
---|
[ac7d5ef0] | 76 | RTEMS_DEFAULT_MODES, |
---|
[a0271a7] | 77 | RTEMS_FLOATING_POINT, |
---|
[ac7d5ef0] | 78 | &Task_id[ index ] |
---|
| 79 | ); |
---|
| 80 | directive_failed( status, "rtems_task_create loop" ); |
---|
| 81 | } |
---|
| 82 | |
---|
[cf42c54c] | 83 | for ( index = 1 ; index <= 6 ; index++ ) { |
---|
| 84 | status = rtems_task_start( Task_id[ index ], Task_1_through_6, index ); |
---|
[ac7d5ef0] | 85 | directive_failed( status, "rtems_task_start loop" ); |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | Count.count[ 1 ] = 0; |
---|
| 89 | Count.count[ 2 ] = 0; |
---|
| 90 | Count.count[ 3 ] = 0; |
---|
| 91 | Count.count[ 4 ] = 0; |
---|
| 92 | Count.count[ 5 ] = 0; |
---|
[cf42c54c] | 93 | Count.count[ 6 ] = 0; |
---|
[ac7d5ef0] | 94 | |
---|
| 95 | status = rtems_task_delete( RTEMS_SELF ); |
---|
| 96 | directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); |
---|
| 97 | } |
---|