source: rtems/testsuites/sptests/sp13/task3.c @ 3235ad9

4.104.114.84.95
Last change on this file since 3235ad9 was 3235ad9, checked in by Joel Sherrill <joel.sherrill@…>, on 08/23/95 at 19:30:23

Support for variable length names added to Object Handler. This supports
both fixed length "raw" names and strings from the API's point of view.

Both inline and macro implementations were tested.

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/*  Task_3
2 *
3 *  This routine serves as a test task.  Its major function is to
4 *  broadcast a messge to all the other tasks.
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
24rtems_task Task_3(
25  rtems_task_argument argument
26)
27{
28  long              buffer[ 4 ];
29  rtems_unsigned32  size;
30  rtems_unsigned32  count;
31  rtems_status_code status;
32
33  puts(
34    "TA3 - rtems_message_queue_receive - receive from queue 2 - "
35      "RTEMS_WAIT FOREVER"
36  );
37  status = rtems_message_queue_receive(
38    Queue_id[ 2 ],
39    (long (*)[4])buffer,
40    &size,
41    RTEMS_DEFAULT_OPTIONS,
42    RTEMS_NO_TIMEOUT
43  );
44  directive_failed( status, "rtems_message_queue_receive" );
45  puts_nocr( "TA3 - buffer received: " );
46  Put_buffer( buffer );
47  new_line;
48
49  Fill_buffer( "BUFFER 3 TO Q 1", (long *)buffer );
50  puts( "TA3 - rtems_message_queue_broadcast - BUFFER 3 TO Q 1" );
51  status = rtems_message_queue_broadcast(
52    Queue_id[ 1 ],
53    (long (*)[4])buffer,
54    16,
55    &count
56  );
57  printf( "TA3 - number of tasks awakened = %02d\n", count );
58  puts(
59    "TA3 - rtems_message_queue_receive - receive from queue 3 - "
60      "RTEMS_WAIT FOREVER"
61  );
62
63  status = rtems_message_queue_receive(
64    Queue_id[ 3 ],
65    (long (*)[4])buffer,
66    &size,
67    RTEMS_DEFAULT_OPTIONS,
68    RTEMS_NO_TIMEOUT
69  );
70  directive_failed( status, "rtems_message_queue_receive" );
71  puts_nocr( "TA3 - buffer received: " );
72  Put_buffer( buffer );
73  new_line;
74
75  puts( "TA3 - rtems_task_delete - delete self" );
76  status = rtems_task_delete( RTEMS_SELF );
77  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
78}
Note: See TracBrowser for help on using the repository browser.