source: rtems/cpukit/rtems/include/rtems/rtems/event.h @ 277cc95

4.104.114.84.95
Last change on this file since 277cc95 was 277cc95, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:54:32

2003-09-04 Joel Sherrill <joel@…>

  • include/rtems.h, include/rtems/rtems/asr.h, include/rtems/rtems/attr.h, include/rtems/rtems/cache.h, include/rtems/rtems/clock.h, include/rtems/rtems/config.h, include/rtems/rtems/dpmem.h, include/rtems/rtems/event.h, include/rtems/rtems/eventmp.h, include/rtems/rtems/eventset.h, include/rtems/rtems/intr.h, include/rtems/rtems/message.h, include/rtems/rtems/modes.h, include/rtems/rtems/mp.h, include/rtems/rtems/msgmp.h, include/rtems/rtems/options.h, include/rtems/rtems/part.h, include/rtems/rtems/partmp.h, include/rtems/rtems/ratemon.h, include/rtems/rtems/region.h, include/rtems/rtems/regionmp.h, include/rtems/rtems/rtemsapi.h, include/rtems/rtems/sem.h, include/rtems/rtems/semmp.h, include/rtems/rtems/signal.h, include/rtems/rtems/signalmp.h, include/rtems/rtems/status.h, include/rtems/rtems/support.h, include/rtems/rtems/taskmp.h, include/rtems/rtems/tasks.h, include/rtems/rtems/timer.h, include/rtems/rtems/types.h, inline/rtems/rtems/asr.inl, inline/rtems/rtems/attr.inl, inline/rtems/rtems/dpmem.inl, inline/rtems/rtems/event.inl, inline/rtems/rtems/eventset.inl, inline/rtems/rtems/message.inl, inline/rtems/rtems/modes.inl, inline/rtems/rtems/options.inl, inline/rtems/rtems/part.inl, inline/rtems/rtems/ratemon.inl, inline/rtems/rtems/region.inl, inline/rtems/rtems/sem.inl, inline/rtems/rtems/status.inl, inline/rtems/rtems/support.inl, inline/rtems/rtems/tasks.inl, inline/rtems/rtems/timer.inl, macros/rtems/rtems/asr.inl, macros/rtems/rtems/attr.inl, macros/rtems/rtems/dpmem.inl, macros/rtems/rtems/event.inl, macros/rtems/rtems/eventset.inl, macros/rtems/rtems/message.inl, macros/rtems/rtems/modes.inl, macros/rtems/rtems/options.inl, macros/rtems/rtems/part.inl, macros/rtems/rtems/ratemon.inl, macros/rtems/rtems/region.inl, macros/rtems/rtems/sem.inl, macros/rtems/rtems/status.inl, macros/rtems/rtems/support.inl, macros/rtems/rtems/tasks.inl, macros/rtems/rtems/timer.inl, src/attr.c, src/clockget.c, src/clockset.c, src/clocktick.c, src/dpmem.c, src/dpmemcreate.c, src/dpmemdelete.c, src/dpmemexternal2internal.c, src/dpmemident.c, src/dpmeminternal2external.c, src/event.c, src/eventmp.c, src/eventreceive.c, src/eventseize.c, src/eventsend.c, src/eventsurrender.c, src/eventtimeout.c, src/intr.c, src/intrbody.c, src/intrcatch.c, src/mp.c, src/msg.c, src/msgmp.c, src/msgqallocate.c, src/msgqbroadcast.c, src/msgqcreate.c, src/msgqdelete.c, src/msgqflush.c, src/msgqgetnumberpending.c, src/msgqident.c, src/msgqreceive.c, src/msgqsend.c, src/msgqsubmit.c, src/msgqtranslatereturncode.c, src/msgqurgent.c, src/part.c, src/partcreate.c, src/partdelete.c, src/partgetbuffer.c, src/partident.c, src/partmp.c, src/partreturnbuffer.c, src/ratemon.c, src/ratemoncancel.c, src/ratemoncreate.c, src/ratemondelete.c, src/ratemongetstatus.c, src/ratemonident.c, src/ratemonperiod.c, src/ratemontimeout.c, src/region.c, src/regioncreate.c, src/regiondelete.c, src/regionextend.c, src/regiongetinfo.c, src/regiongetsegment.c, src/regiongetsegmentsize.c, src/regionident.c, src/regionmp.c, src/regionreturnsegment.c, src/rtclock.c, src/rtemsidtoname.c, src/rtemstimer.c, src/sem.c, src/semcreate.c, src/semdelete.c, src/semflush.c, src/semident.c, src/semmp.c, src/semobtain.c, src/semrelease.c, src/semtranslatereturncode.c, src/signal.c, src/signalcatch.c, src/signalmp.c, src/signalsend.c, src/taskcreate.c, src/taskdelete.c, src/taskgetnote.c, src/taskident.c, src/taskinitusers.c, src/taskissuspended.c, src/taskmode.c, src/taskmp.c, src/taskrestart.c, src/taskresume.c, src/tasks.c, src/tasksetnote.c, src/tasksetpriority.c, src/taskstart.c, src/tasksuspend.c, src/taskvariableadd.c, src/taskvariabledelete.c, src/taskvariableget.c, src/taskwakeafter.c, src/taskwakewhen.c, src/timercancel.c, src/timercreate.c, src/timerdelete.c, src/timerfireafter.c, src/timerfirewhen.c, src/timergetinfo.c, src/timerident.c, src/timerreset.c, src/timerserver.c, src/timerserverfireafter.c, src/timerserverfirewhen.c: URL for license changed.
  • 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-1999.
14 *  On-Line Applications Research Corporation (OAR).
15 *
16 *  The license and distribution terms for this file may be
17 *  found in the file LICENSE in this distribution or at
18 *  http://www.rtems.com/license/LICENSE.
19 *
20 *  $Id$
21 */
22
23#ifndef __RTEMS_EVENT_h
24#define __RTEMS_EVENT_h
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#include <rtems/score/object.h>
31#include <rtems/rtems/types.h>
32#include <rtems/rtems/options.h>
33#include <rtems/score/thread.h>
34#include <rtems/score/watchdog.h>
35#include <rtems/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 *  The following enumerated types indicate what happened while the event
46 *  manager was in the synchronization window.
47 */
48
49typedef enum {
50  EVENT_SYNC_SYNCHRONIZED,
51  EVENT_SYNC_NOTHING_HAPPENED,
52  EVENT_SYNC_TIMEOUT,
53  EVENT_SYNC_SATISFIED
54}  Event_Sync_states;
55
56/*
57 *  Event_Manager_initialization
58 *
59 *  DESCRIPTION:
60 *
61 *  This routine performs the initialization necessary for this manager.
62 */
63 
64void _Event_Manager_initialization( void );
65
66/*
67 *  rtems_event_send
68 *
69 *  DESCRIPTION:
70 *
71 *  This routine implements the rtems_event_send directive.  It sends
72 *  event_in to the task specified by ID.  If the task is blocked
73 *  waiting to receive events and the posting of event_in satisfies
74 *  the task's event condition, then it is unblocked.
75 */
76
77rtems_status_code rtems_event_send (
78  Objects_Id         id,
79  rtems_event_set event_in
80);
81
82/*
83 *  rtems_event_receive
84 *
85 *  DESCRIPTION:
86 *
87 *  This routine implements the rtems_event_receive directive.  This
88 *  directive is invoked when the calling task wishes to receive
89 *  the event_in event condition.  One of the fields in the option_set
90 *  parameter determines whether the receive request is satisfied if
91 *  any or all of the events are pending.   If the event condition
92 *  is not satisfied immediately, then the task may block with an
93 *  optional timeout of TICKS clock ticks or return immediately.
94 *  This determination is based on another field in the option_set
95 *  parameter.  This directive returns the events received in the
96 *  event_out parameter.
97 */
98
99rtems_status_code rtems_event_receive (
100  rtems_event_set  event_in,
101  rtems_option     option_set,
102  rtems_interval   ticks,
103  rtems_event_set *event_out
104);
105
106/*
107 *  _Event_Seize
108 *
109 *  DESCRIPTION:
110 *
111 *  This routine determines if the event condition event_in is
112 *  satisfied.  If so or if the no_wait option is enabled in option_set,
113 *  then the procedure returns immediately.  If neither of these
114 *  conditions is true, then the calling task is blocked with an
115 *  optional timeout of ticks clock ticks.
116 */
117
118void _Event_Seize (
119  rtems_event_set  event_in,
120  rtems_option     option_set,
121  rtems_interval   ticks,
122  rtems_event_set *event_out
123);
124
125/*
126 *  _Event_Surrender
127 *
128 *  DESCRIPTION:
129 *
130 *  This routine determines if the event condition of the_thread
131 *  has been satisfied.  If so, it unblocks the_thread.
132 */
133
134void _Event_Surrender (
135  Thread_Control *the_thread
136);
137
138/*
139 *  _Event_Timeout
140 *
141 *  DESCRIPTION:
142 *
143 *  This routine is invoked when a task's event receive request
144 *  has not been satisfied after the specified timeout interval.
145 *  The task represented by ID will be unblocked and its status
146 *  code will be set in it's control block to indicate that a timeout
147 *  has occurred.
148 */
149
150void _Event_Timeout (
151  Objects_Id  id,
152  void       *ignored
153);
154
155/*
156 *  The following defines the synchronization flag used by the
157 *  Event Manager to insure that signals sent to the currently
158 *  executing thread are received properly.
159 */
160
161RTEMS_EXTERN volatile Event_Sync_states _Event_Sync_state;
162
163#if defined(RTEMS_MULTIPROCESSING)
164#include <rtems/rtems/eventmp.h>
165#endif
166#ifndef __RTEMS_APPLICATION__
167#include <rtems/rtems/event.inl>
168#endif
169
170#ifdef __cplusplus
171}
172#endif
173
174#endif
175/* end of include file */
Note: See TracBrowser for help on using the repository browser.