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-1997. |
---|
12 | * On-Line Applications Research Corporation (OAR). |
---|
13 | * Copyright assigned to U.S. Government, 1994. |
---|
14 | * |
---|
15 | * The license and distribution terms for this file may in |
---|
16 | * the file LICENSE in this distribution or at |
---|
17 | * http://www.OARcorp.com/rtems/license.html. |
---|
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 | rtems_unsigned32 yield_count; |
---|
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!!" ); |
---|
47 | rtems_task_wake_after(2); |
---|
48 | } |
---|
49 | |
---|
50 | yield_count = 100; |
---|
51 | |
---|
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 | |
---|
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 | } |
---|
66 | } |
---|
67 | put_dot( 'p' ); |
---|
68 | } |
---|
69 | |
---|
70 | Exit_test(); |
---|
71 | } |
---|