RTEMS
eventimpl.h
Go to the documentation of this file.
1 
9 /* COPYRIGHT (c) 1989-2008.
10  * On-Line Applications Research Corporation (OAR).
11  *
12  * The license and distribution terms for this file may be
13  * found in the file LICENSE in this distribution or at
14  * http://www.rtems.org/license/LICENSE.
15  */
16 
17 #ifndef _RTEMS_RTEMS_EVENTIMPL_H
18 #define _RTEMS_RTEMS_EVENTIMPL_H
19 
20 #include <rtems/rtems/eventdata.h>
21 #include <rtems/score/thread.h>
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
39 #define EVENT_CURRENT 0
40 
45 #define EVENT_SETS_NONE_PENDING 0
46 
47 rtems_status_code _Event_Seize(
48  rtems_event_set event_in,
49  rtems_option option_set,
50  rtems_interval ticks,
51  rtems_event_set *event_out,
52  Thread_Control *executing,
53  Event_Control *event,
54  Thread_Wait_flags wait_class,
55  States_Control block_state,
56  ISR_lock_Context *lock_context
57 );
58 
59 rtems_status_code _Event_Surrender(
60  Thread_Control *the_thread,
61  rtems_event_set event_in,
62  Event_Control *event,
63  Thread_Wait_flags wait_class,
64  ISR_lock_Context *lock_context
65 );
66 
70 void _Event_Timeout(
71  Objects_Id id,
72  void *arg
73 );
74 
75 RTEMS_INLINE_ROUTINE void _Event_Initialize( Event_Control *event )
76 {
77  event->pending_events = EVENT_SETS_NONE_PENDING;
78 }
79 
87  rtems_event_set the_event_set
88 )
89 {
90  return ( the_event_set == 0 );
91 }
92 
100  rtems_event_set the_new_events,
101  rtems_event_set *the_event_set
102 )
103 {
104  *the_event_set |= the_new_events;
105 }
106 
114  rtems_event_set the_event_set,
115  rtems_event_set the_event_condition
116 )
117 {
118  return ( the_event_set & the_event_condition );
119 }
120 
128  rtems_event_set the_event_set,
129  rtems_event_set the_mask
130 )
131 {
132  return ( the_event_set & ~(the_mask) );
133 }
134 
137 #ifdef __cplusplus
138 }
139 #endif
140 
141 #if defined(RTEMS_MULTIPROCESSING)
142 #include <rtems/rtems/eventmp.h>
143 #endif
144 
145 #endif
146 /* end of include file */
Classic Event Manager Data Structures.
uint32_t rtems_option
This type is used to represent an option set.
Definition: options.h:121
#define EVENT_SETS_NONE_PENDING
Definition: eventimpl.h:45
uint32_t States_Control
Definition: states.h:46
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:82
unsigned int Thread_Wait_flags
This type is able to contain several flags used to control the wait class and state of a thread...
Definition: thread.h:383
static __inline__ rtems_event_set _Event_sets_Get(rtems_event_set the_event_set, rtems_event_set the_event_condition)
Returns the events in event_condition that are set in event_set.
Definition: eventimpl.h:113
static __inline__ rtems_event_set _Event_sets_Clear(rtems_event_set the_event_set, rtems_event_set the_mask)
Removes the events in mask from the event_set passed in.
Definition: eventimpl.h:127
Watchdog_Interval rtems_interval
This type is used to represent clock tick intervals.
Definition: types.h:90
static __inline__ bool _Event_sets_Is_empty(rtems_event_set the_event_set)
Checks if on events are posted in the event_set.
Definition: eventimpl.h:86
uint32_t Objects_Id
Definition: object.h:80
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
#define RTEMS_INLINE_ROUTINE
Gives a hint to the compiler in a function declaration to inline this function.
Definition: basedefs.h:683
static __inline__ void _Event_sets_Post(rtems_event_set the_new_events, rtems_event_set *the_event_set)
Posts the given new_events into the event_set passed in.
Definition: eventimpl.h:99
uint32_t rtems_event_set
This integer type can hold an event set of up to 32 events represented as a bit field.
Definition: event.h:94
Constants and Structures Related with the Thread Control Block.
void _Event_Timeout(Objects_Id id, void *arg)
Timeout Event.