[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; |
---|
| 32 | void *buffer; |
---|
| 33 | |
---|
| 34 | puts( "Getting ID of partition" ); |
---|
| 35 | while ( FOREVER ) { |
---|
| 36 | status = rtems_partition_ident( |
---|
| 37 | Partition_name[ 1 ], |
---|
| 38 | RTEMS_SEARCH_ALL_NODES, |
---|
| 39 | &Partition_id[ 1 ] |
---|
| 40 | ); |
---|
| 41 | |
---|
| 42 | if ( status == RTEMS_SUCCESSFUL ) |
---|
| 43 | break; |
---|
| 44 | |
---|
| 45 | puts( "rtems_partition_ident FAILED!!" ); |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | while ( Stop_Test == FALSE ) { |
---|
| 49 | for ( count=PARTITION_DOT_COUNT ; Stop_Test == FALSE && count ; count-- ) { |
---|
| 50 | status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer ); |
---|
| 51 | directive_failed( status, "rtems_partition_get_buffer" ); |
---|
| 52 | |
---|
| 53 | status = rtems_partition_return_buffer( Partition_id[ 1 ], buffer ); |
---|
| 54 | directive_failed( status, "rtems_partition_return_buffer" ); |
---|
| 55 | |
---|
| 56 | if ( Multiprocessing_configuration.node == 1 ) { |
---|
| 57 | status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); |
---|
| 58 | directive_failed( status, "rtems_task_wake_after" ); |
---|
| 59 | } |
---|
| 60 | } |
---|
| 61 | put_dot( 'p' ); |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | Exit_test(); |
---|
| 65 | } |
---|