source: rtems/cpukit/rtems/include/rtems/rtems/event.h @ ac7d5ef0

4.104.114.84.95
Last change on this file since ac7d5ef0 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/11/95 at 17:39:37

Initial revision

  • Property mode set to 100644
File size: 3.9 KB
Line 
1/*  event.h
2 *
3 *  This include file contains the information pertaining to the Event
4 *  Manager.  This manager provides a high performance method of communication
5 *  and synchronization.
6 *
7 *  Directives provided are:
8 *
9 *     + send an event set to a task
10 *     + receive event condition
11 *
12 *
13 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
14 *  On-Line Applications Research Corporation (OAR).
15 *  All rights assigned to U.S. Government, 1994.
16 *
17 *  This material may be reproduced by or for the U.S. Government pursuant
18 *  to the copyright license under the clause at DFARS 252.227-7013.  This
19 *  notice must appear in all copies of this file and its derivatives.
20 *
21 *  $Id$
22 */
23
24#ifndef __RTEMS_EVENT_h
25#define __RTEMS_EVENT_h
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#include <rtems/object.h>
32#include <rtems/options.h>
33#include <rtems/thread.h>
34#include <rtems/watchdog.h>
35#include <rtems/eventset.h>
36
37/*
38 *  This constant is passed as the event_in to the
39 *  rtems_event_receive directive to determine which events are pending.
40 */
41
42#define EVENT_CURRENT  0
43
44/*
45 *  _Event_Manager_initialization
46 *
47 *  DESCRIPTION:
48 *
49 *  This routine performs the initialization necessary for this manager.
50 */
51
52STATIC INLINE void _Event_Manager_initialization( void );
53
54/*
55 *  rtems_event_send
56 *
57 *  DESCRIPTION:
58 *
59 *  This routine implements the rtems_event_send directive.  It sends
60 *  event_in to the task specified by ID.  If the task is blocked
61 *  waiting to receive events and the posting of event_in satisfies
62 *  the task's event condition, then it is unblocked.
63 */
64
65rtems_status_code rtems_event_send (
66  Objects_Id         id,
67  rtems_event_set event_in
68);
69
70/*
71 *  rtems_event_receive
72 *
73 *  DESCRIPTION:
74 *
75 *  This routine implements the rtems_event_receive directive.  This
76 *  directive is invoked when the calling task wishes to receive
77 *  the event_in event condition.  One of the fields in the option_set
78 *  parameter determines whether the receive request is satisfied if
79 *  any or all of the events are pending.   If the event condition
80 *  is not satisfied immediately, then the task may block with an
81 *  optional timeout of TICKS clock ticks or return immediately.
82 *  This determination is based on another field in the option_set
83 *  parameter.  This directive returns the events received in the
84 *  event_out parameter.
85 */
86
87rtems_status_code rtems_event_receive (
88  rtems_event_set  event_in,
89  rtems_option     option_set,
90  rtems_interval   ticks,
91  rtems_event_set *event_out
92);
93
94/*
95 *  _Event_Seize
96 *
97 *  DESCRIPTION:
98 *
99 *  This routine determines if the event condition event_in is
100 *  satisfied.  If so or if the no_wait option is enabled in option_set,
101 *  then the procedure returns immediately.  If neither of these
102 *  conditions is true, then the calling task is blocked with an
103 *  optional timeout of ticks clock ticks.
104 */
105
106void _Event_Seize (
107  rtems_event_set event_in,
108  rtems_option    option_set,
109  rtems_interval  ticks
110);
111
112/*
113 *  _Event_Surrender
114 *
115 *  DESCRIPTION:
116 *
117 *  This routine determines if the event condition of the_thread
118 *  has been satisfied.  If so, it unblocks the_thread.
119 */
120
121void _Event_Surrender (
122  Thread_Control *the_thread
123);
124
125/*
126 *  _Event_Timeout
127 *
128 *  DESCRIPTION:
129 *
130 *  This routine is invoked when a task's event receive request
131 *  has not been satisfied after the specified timeout interval.
132 *  The task represented by ID will be unblocked and its status
133 *  code will be set in it's control block to indicate that a timeout
134 *  has occurred.
135 */
136
137void _Event_Timeout (
138  Objects_Id  id,
139  void       *ignored
140);
141
142/*
143 *  The following defines the synchronization flag used by the
144 *  Event Manager to insure that signals sent to the currently
145 *  executing thread are received properly.
146 */
147
148EXTERN boolean _Event_Sync;    /* event manager sync flag */
149
150#include <rtems/event.inl>
151#include <rtems/eventmp.h>
152
153#ifdef __cplusplus
154}
155#endif
156
157#endif
158/* end of include file */
Note: See TracBrowser for help on using the repository browser.