source: rtems/testsuites/mptests/mp14/pttask1.c @ a4bc4d6e

4.115
Last change on this file since a4bc4d6e was a4bc4d6e, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/22/11 at 10:00:39

Add HAVE_CONFIG_H.

  • Property mode set to 100644
File size: 1.8 KB
Line 
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#ifdef HAVE_CONFIG_H
22#include "config.h"
23#endif
24
25#include "system.h"
26
27extern rtems_multiprocessing_table Multiprocessing_configuration;
28
29rtems_task Partition_task(
30  rtems_task_argument argument
31)
32{
33  uint32_t     count;
34  rtems_status_code  status;
35  uint32_t     yield_count;
36  void              *buffer;
37
38  puts( "Getting ID of partition" );
39  while ( FOREVER ) {
40    status = rtems_partition_ident(
41      Partition_name[ 1 ],
42      RTEMS_SEARCH_ALL_NODES,
43      &Partition_id[ 1 ]
44    );
45
46    if ( status == RTEMS_SUCCESSFUL )
47      break;
48
49    puts( "rtems_partition_ident FAILED!!" );
50    rtems_task_wake_after(2);
51  }
52
53  yield_count = 100;
54
55  while ( Stop_Test == false ) {
56    for ( count=PARTITION_DOT_COUNT ; Stop_Test == false && count ; count-- ) {
57      status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer );
58      directive_failed( status, "rtems_partition_get_buffer" );
59
60      status = rtems_partition_return_buffer( Partition_id[ 1 ], buffer );
61      directive_failed( status, "rtems_partition_return_buffer" );
62
63      if (Stop_Test == false)
64        if ( Multiprocessing_configuration.node == 1 && --yield_count == 0 ) {
65          status = rtems_task_wake_after( 1 );
66          directive_failed( status, "rtems_task_wake_after" );
67          yield_count = 100;
68        }
69    }
70    put_dot( 'p' );
71  }
72
73  Exit_test();
74}
Note: See TracBrowser for help on using the repository browser.