source: rtems/c/src/exec/rtems/inline/rtems/rtems/eventset.inl @ 7e4938c

4.104.114.84.95
Last change on this file since 7e4938c was 7e4938c, checked in by Joel Sherrill <joel.sherrill@…>, on 10/06/97 at 21:28:40

Make Post an atomic operation.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*  inline/eventset.inl
2 *
3 *  This include file contains the information pertaining to event sets.
4 *
5 *  COPYRIGHT (c) 1989-1997.
6 *  On-Line Applications Research Corporation (OAR).
7 *  Copyright assigned to U.S. Government, 1994.
8 *
9 *  The license and distribution terms for this file may in
10 *  the file LICENSE in this distribution or at
11 *  http://www.OARcorp.com/rtems/license.html.
12 *
13 *  $Id$
14 */
15
16#ifndef __INLINE_EVENT_SET_inl
17#define __INLINE_EVENT_SET_inl
18
19/*PAGE
20 *
21 *  _Event_sets_Is_empty
22 *
23 *  DESCRIPTION:
24 *
25 *  This function returns TRUE if on events are posted in the event_set,
26 *  and FALSE otherwise.
27 */
28
29RTEMS_INLINE_ROUTINE boolean _Event_sets_Is_empty(
30  rtems_event_set the_event_set
31)
32{
33  return ( the_event_set == 0 );
34}
35
36/*PAGE
37 *
38 *  _Event_sets_Post
39 *
40 *  DESCRIPTION:
41 *
42 *  This routine posts the given new_events into the event_set
43 *  passed in.  The result is returned to the user in event_set.
44 */
45
46RTEMS_INLINE_ROUTINE void _Event_sets_Post(
47  rtems_event_set  the_new_events,
48  rtems_event_set *the_event_set
49)
50{
51  ISR_Level level;
52
53  _ISR_Disable( level );
54    *the_event_set |= the_new_events;
55  _ISR_Enable( level );
56}
57
58/*PAGE
59 *
60 *  _Event_sets_Get
61 *
62 *  DESCRIPTION:
63 *
64 *  This function returns the events in event_condition which are
65 *  set in event_set.
66 */
67
68RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get(
69  rtems_event_set the_event_set,
70  rtems_event_set the_event_condition
71)
72{
73   return ( the_event_set & the_event_condition );
74}
75
76/*PAGE
77 *
78 *  _Event_sets_Clear
79 *
80 *  DESCRIPTION:
81 *
82 *  This function removes the events in mask from the event_set
83 *  passed in.  The result is returned to the user in event_set.
84 */
85
86RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear(
87 rtems_event_set the_event_set,
88 rtems_event_set the_mask
89)
90{
91   return ( the_event_set & ~(the_mask) );
92}
93
94#endif
95/* end of include file */
Note: See TracBrowser for help on using the repository browser.