OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [rtems/] [include/] [rtems/] [rtems/] [event.h] - Blame information for rev 314

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  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.OARcorp.com/rtems/license.html.
19
 *
20
 *  $Id: event.h,v 1.2 2001-09-27 11:59:18 chris Exp $
21
 */
22
 
23
#ifndef __RTEMS_EVENT_h
24
#define __RTEMS_EVENT_h
25
 
26
#ifdef __cplusplus
27
extern "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
 
49
typedef 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
 
64
void _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
 
77
rtems_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
 
99
rtems_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
 
118
void _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
 
134
void _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
 
150
void _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
 
161
RTEMS_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 */

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.