[ac7d5ef0] | 1 | /* Partition_task |
---|
| 2 | * |
---|
| 3 | * This task continuously gets a buffer from and returns that buffer |
---|
| 4 | * to a global partition. |
---|
| 5 | * |
---|
| 6 | * Input parameters: |
---|
| 7 | * argument - task argument |
---|
| 8 | * |
---|
| 9 | * Output parameters: NONE |
---|
| 10 | * |
---|
| 11 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
| 12 | * On-Line Applications Research Corporation (OAR). |
---|
| 13 | * All rights assigned to U.S. Government, 1994. |
---|
| 14 | * |
---|
| 15 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
| 16 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
| 17 | * notice must appear in all copies of this file and its derivatives. |
---|
| 18 | * |
---|
| 19 | * $Id$ |
---|
| 20 | */ |
---|
| 21 | |
---|
| 22 | #include "system.h" |
---|
| 23 | |
---|
| 24 | extern rtems_multiprocessing_table Multiprocessing_configuration; |
---|
| 25 | |
---|
| 26 | rtems_task Partition_task( |
---|
| 27 | rtems_task_argument argument |
---|
| 28 | ) |
---|
| 29 | { |
---|
| 30 | rtems_unsigned32 count; |
---|
| 31 | rtems_status_code status; |
---|
[2122a0b] | 32 | rtems_unsigned32 yield_count; |
---|
[ac7d5ef0] | 33 | void *buffer; |
---|
| 34 | |
---|
| 35 | puts( "Getting ID of partition" ); |
---|
| 36 | while ( FOREVER ) { |
---|
| 37 | status = rtems_partition_ident( |
---|
| 38 | Partition_name[ 1 ], |
---|
| 39 | RTEMS_SEARCH_ALL_NODES, |
---|
| 40 | &Partition_id[ 1 ] |
---|
| 41 | ); |
---|
| 42 | |
---|
| 43 | if ( status == RTEMS_SUCCESSFUL ) |
---|
| 44 | break; |
---|
| 45 | |
---|
| 46 | puts( "rtems_partition_ident FAILED!!" ); |
---|
[2122a0b] | 47 | rtems_task_wake_after(2); |
---|
[ac7d5ef0] | 48 | } |
---|
| 49 | |
---|
[2122a0b] | 50 | yield_count = 100; |
---|
| 51 | |
---|
[ac7d5ef0] | 52 | while ( Stop_Test == FALSE ) { |
---|
| 53 | for ( count=PARTITION_DOT_COUNT ; Stop_Test == FALSE && count ; count-- ) { |
---|
| 54 | status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer ); |
---|
| 55 | directive_failed( status, "rtems_partition_get_buffer" ); |
---|
| 56 | |
---|
| 57 | status = rtems_partition_return_buffer( Partition_id[ 1 ], buffer ); |
---|
| 58 | directive_failed( status, "rtems_partition_return_buffer" ); |
---|
| 59 | |
---|
[2122a0b] | 60 | if (Stop_Test == FALSE) |
---|
| 61 | if ( Multiprocessing_configuration.node == 1 && --yield_count == 0 ) { |
---|
| 62 | status = rtems_task_wake_after( 1 ); |
---|
| 63 | directive_failed( status, "rtems_task_wake_after" ); |
---|
| 64 | yield_count = 100; |
---|
| 65 | } |
---|
[ac7d5ef0] | 66 | } |
---|
| 67 | put_dot( 'p' ); |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | Exit_test(); |
---|
| 71 | } |
---|