source: rtems/c/src/exec/rtems/include/rtems/rtems/event.h @ f3dabb04

4.104.114.84.95
Last change on this file since f3dabb04 was f3dabb04, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 8, 1996 at 10:16:35 PM

changed synchronization algorithm to be a single list of enumerated states

  • Property mode set to 100644
File size: 4.2 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/score/object.h>
32#include <rtems/rtems/types.h>
33#include <rtems/rtems/options.h>
34#include <rtems/score/thread.h>
35#include <rtems/score/watchdog.h>
36#include <rtems/rtems/eventset.h>
37
38/*
39 *  This constant is passed as the event_in to the
40 *  rtems_event_receive directive to determine which events are pending.
41 */
42
43#define EVENT_CURRENT  0
44
45/*
46 *  The following enumerated types indicate what happened while the event
47 *  manager was in the synchronization window.
48 */
49
50typedef enum {
51  EVENT_SYNC_SYNCHRONIZED,
52  EVENT_SYNC_NOTHING_HAPPENED,
53  EVENT_SYNC_TIMEOUT,
54  EVENT_SYNC_SATISFIED
55}  Event_Sync_states;
56
57/*
58 *  _Event_Manager_initialization
59 *
60 *  DESCRIPTION:
61 *
62 *  This routine performs the initialization necessary for this manager.
63 */
64
65STATIC INLINE void _Event_Manager_initialization( void );
66
67/*
68 *  rtems_event_send
69 *
70 *  DESCRIPTION:
71 *
72 *  This routine implements the rtems_event_send directive.  It sends
73 *  event_in to the task specified by ID.  If the task is blocked
74 *  waiting to receive events and the posting of event_in satisfies
75 *  the task's event condition, then it is unblocked.
76 */
77
78rtems_status_code rtems_event_send (
79  Objects_Id         id,
80  rtems_event_set event_in
81);
82
83/*
84 *  rtems_event_receive
85 *
86 *  DESCRIPTION:
87 *
88 *  This routine implements the rtems_event_receive directive.  This
89 *  directive is invoked when the calling task wishes to receive
90 *  the event_in event condition.  One of the fields in the option_set
91 *  parameter determines whether the receive request is satisfied if
92 *  any or all of the events are pending.   If the event condition
93 *  is not satisfied immediately, then the task may block with an
94 *  optional timeout of TICKS clock ticks or return immediately.
95 *  This determination is based on another field in the option_set
96 *  parameter.  This directive returns the events received in the
97 *  event_out parameter.
98 */
99
100rtems_status_code rtems_event_receive (
101  rtems_event_set  event_in,
102  rtems_option     option_set,
103  rtems_interval   ticks,
104  rtems_event_set *event_out
105);
106
107/*
108 *  _Event_Seize
109 *
110 *  DESCRIPTION:
111 *
112 *  This routine determines if the event condition event_in is
113 *  satisfied.  If so or if the no_wait option is enabled in option_set,
114 *  then the procedure returns immediately.  If neither of these
115 *  conditions is true, then the calling task is blocked with an
116 *  optional timeout of ticks clock ticks.
117 */
118
119void _Event_Seize (
120  rtems_event_set  event_in,
121  rtems_option     option_set,
122  rtems_interval   ticks,
123  rtems_event_set *event_out
124);
125
126/*
127 *  _Event_Surrender
128 *
129 *  DESCRIPTION:
130 *
131 *  This routine determines if the event condition of the_thread
132 *  has been satisfied.  If so, it unblocks the_thread.
133 */
134
135void _Event_Surrender (
136  Thread_Control *the_thread
137);
138
139/*
140 *  _Event_Timeout
141 *
142 *  DESCRIPTION:
143 *
144 *  This routine is invoked when a task's event receive request
145 *  has not been satisfied after the specified timeout interval.
146 *  The task represented by ID will be unblocked and its status
147 *  code will be set in it's control block to indicate that a timeout
148 *  has occurred.
149 */
150
151void _Event_Timeout (
152  Objects_Id  id,
153  void       *ignored
154);
155
156/*
157 *  The following defines the synchronization flag used by the
158 *  Event Manager to insure that signals sent to the currently
159 *  executing thread are received properly.
160 */
161
162EXTERN volatile Event_Sync_states _Event_Sync_state;
163
164#include <rtems/rtems/eventmp.h>
165#include <rtems/rtems/event.inl>
166
167#ifdef __cplusplus
168}
169#endif
170
171#endif
172/* end of include file */
Note: See TracBrowser for help on using the repository browser.