OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [tests/] [mptests/] [mp14/] [pttask1.c] - Blame information for rev 609

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  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.OARcorp.com/rtems/license.html.
17
 *
18
 *  $Id: pttask1.c,v 1.2 2001-09-27 12:02:23 chris Exp $
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
  rtems_unsigned32   count;
30
  rtems_status_code  status;
31
  rtems_unsigned32   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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.