source: rtems/testsuites/mptests/mp14/pttask1.c @ 2122a0b

4.104.114.84.95
Last change on this file since 2122a0b was 2122a0b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/19/95 at 21:44:33

Modifications from Tony Bennett accepted to tune this test a little.

  • Property mode set to 100644
File size: 1.9 KB
RevLine 
[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
24extern rtems_multiprocessing_table Multiprocessing_configuration;
25
26rtems_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}
Note: See TracBrowser for help on using the repository browser.