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

4.104.114.84.95
Last change on this file since 1a8fde6c was 1a8fde6c, checked in by Joel Sherrill <joel.sherrill@…>, on 03/06/96 at 21:34:57

Removed prototyes for static inline routines and moved the comments into
the inline implementation. The impetus for this was twofold. First,
it is incorrect to have static inline prototypes when using the macro
implementation. Second, this reduced the number of lines in the include
files seen by rtems.h by about 2000 lines.

Next we restricted visibility for the inline routines to inside the
executive itself EXCEPT for a handful of objects. This reduced the
number of include files included by rtems.h by 40 files and reduced
the lines in the include files seen by rtems.h by about 6000 lines.

In total, these reduced the compile time of the entire RTEMS tree by 20%.
This results in about 8 minutes savings on the SparcStation? 10 morgana.

  • Property mode set to 100644
File size: 4.1 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 *  rtems_event_send
59 *
60 *  DESCRIPTION:
61 *
62 *  This routine implements the rtems_event_send directive.  It sends
63 *  event_in to the task specified by ID.  If the task is blocked
64 *  waiting to receive events and the posting of event_in satisfies
65 *  the task's event condition, then it is unblocked.
66 */
67
68rtems_status_code rtems_event_send (
69  Objects_Id         id,
70  rtems_event_set event_in
71);
72
73/*
74 *  rtems_event_receive
75 *
76 *  DESCRIPTION:
77 *
78 *  This routine implements the rtems_event_receive directive.  This
79 *  directive is invoked when the calling task wishes to receive
80 *  the event_in event condition.  One of the fields in the option_set
81 *  parameter determines whether the receive request is satisfied if
82 *  any or all of the events are pending.   If the event condition
83 *  is not satisfied immediately, then the task may block with an
84 *  optional timeout of TICKS clock ticks or return immediately.
85 *  This determination is based on another field in the option_set
86 *  parameter.  This directive returns the events received in the
87 *  event_out parameter.
88 */
89
90rtems_status_code rtems_event_receive (
91  rtems_event_set  event_in,
92  rtems_option     option_set,
93  rtems_interval   ticks,
94  rtems_event_set *event_out
95);
96
97/*
98 *  _Event_Seize
99 *
100 *  DESCRIPTION:
101 *
102 *  This routine determines if the event condition event_in is
103 *  satisfied.  If so or if the no_wait option is enabled in option_set,
104 *  then the procedure returns immediately.  If neither of these
105 *  conditions is true, then the calling task is blocked with an
106 *  optional timeout of ticks clock ticks.
107 */
108
109void _Event_Seize (
110  rtems_event_set  event_in,
111  rtems_option     option_set,
112  rtems_interval   ticks,
113  rtems_event_set *event_out
114);
115
116/*
117 *  _Event_Surrender
118 *
119 *  DESCRIPTION:
120 *
121 *  This routine determines if the event condition of the_thread
122 *  has been satisfied.  If so, it unblocks the_thread.
123 */
124
125void _Event_Surrender (
126  Thread_Control *the_thread
127);
128
129/*
130 *  _Event_Timeout
131 *
132 *  DESCRIPTION:
133 *
134 *  This routine is invoked when a task's event receive request
135 *  has not been satisfied after the specified timeout interval.
136 *  The task represented by ID will be unblocked and its status
137 *  code will be set in it's control block to indicate that a timeout
138 *  has occurred.
139 */
140
141void _Event_Timeout (
142  Objects_Id  id,
143  void       *ignored
144);
145
146/*
147 *  The following defines the synchronization flag used by the
148 *  Event Manager to insure that signals sent to the currently
149 *  executing thread are received properly.
150 */
151
152EXTERN volatile Event_Sync_states _Event_Sync_state;
153
154#include <rtems/rtems/eventmp.h>
155#ifndef __RTEMS_APPLICATION__
156#include <rtems/rtems/event.inl>
157#endif
158
159#ifdef __cplusplus
160}
161#endif
162
163#endif
164/* end of include file */
Note: See TracBrowser for help on using the repository browser.