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-1999. |
---|
12 | * On-Line Applications Research Corporation (OAR). |
---|
13 | * |
---|
14 | * The license and distribution terms for this file may be |
---|
15 | * found in the file LICENSE in this distribution or at |
---|
16 | * http://www.rtems.com/license/LICENSE. |
---|
17 | * |
---|
18 | * $Id$ |
---|
19 | */ |
---|
20 | |
---|
21 | #include "system.h" |
---|
22 | |
---|
23 | extern rtems_multiprocessing_table Multiprocessing_configuration; |
---|
24 | |
---|
25 | rtems_task Partition_task( |
---|
26 | rtems_task_argument argument |
---|
27 | ) |
---|
28 | { |
---|
29 | uint32_t count; |
---|
30 | rtems_status_code status; |
---|
31 | uint32_t yield_count; |
---|
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 | rtems_task_wake_after(2); |
---|
47 | } |
---|
48 | |
---|
49 | yield_count = 100; |
---|
50 | |
---|
51 | while ( Stop_Test == FALSE ) { |
---|
52 | for ( count=PARTITION_DOT_COUNT ; Stop_Test == FALSE && count ; count-- ) { |
---|
53 | status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer ); |
---|
54 | directive_failed( status, "rtems_partition_get_buffer" ); |
---|
55 | |
---|
56 | status = rtems_partition_return_buffer( Partition_id[ 1 ], buffer ); |
---|
57 | directive_failed( status, "rtems_partition_return_buffer" ); |
---|
58 | |
---|
59 | if (Stop_Test == FALSE) |
---|
60 | if ( Multiprocessing_configuration.node == 1 && --yield_count == 0 ) { |
---|
61 | status = rtems_task_wake_after( 1 ); |
---|
62 | directive_failed( status, "rtems_task_wake_after" ); |
---|
63 | yield_count = 100; |
---|
64 | } |
---|
65 | } |
---|
66 | put_dot( 'p' ); |
---|
67 | } |
---|
68 | |
---|
69 | Exit_test(); |
---|
70 | } |
---|