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

4.104.114.84.95
Last change on this file since c32fb8f was d8e681e, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/30/04 at 11:18:29

2004-03-30 Ralf Corsepius <ralf_corsepius@…>

  • mp02/task1.c, mp03/system.h, mp03/task1.c, mp04/task1.c, mp05/system.h, mp06/task1.c, mp07/task1.c, mp08/task1.c, mp09/recvmsg.c, mp09/sendmsg.c, mp09/task1.c, mp10/task1.c, mp11/init.c, mp12/init.c, mp13/task1.c, mp14/evtask1.c, mp14/evtmtask.c, mp14/init.c, mp14/msgtask1.c, mp14/pttask1.c, mp14/smtask1.c, mp14/system.h: Convert to using c99 fixed size types.
  • Property mode set to 100644
File size: 1.7 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#include "system.h"
22
23extern rtems_multiprocessing_table Multiprocessing_configuration;
24
25rtems_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}
Note: See TracBrowser for help on using the repository browser.