source: rtems/cpukit/itron/inline/rtems/itron/eventflags.inl @ 22d66ab

4.104.114.95
Last change on this file since 22d66ab was 22d66ab, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/04/08 at 16:04:00

Convert to "bool".

  • Property mode set to 100644
File size: 3.8 KB
Line 
1/**
2 * @file rtems/itron/eventflags.inl
3 */
4
5/*
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef _RTEMS_ITRON_EVENTFLAGS_H
17# error "Never use <rtems/itron/eventflags.inl> directly; include <rtems/itron/eventflags.h> instead."
18#endif
19
20#ifndef _RTEMS_ITRON_EVENTFLAGS_INL
21#define _RTEMS_ITRON_EVENTFLAGS_INL
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/*
28 *  _ITRON_Eventflags_Allocate
29 *
30 *  DESCRIPTION:
31 *
32 *  This routine allocates the eventflags associated with the specified
33 *  eventflags ID from the pool of inactive eventflagss.
34 *
35 *  Input parameters:
36 *    flgid   - id of eventflags to allocate
37 *    status  - pointer to status variable
38 *
39 *  Output parameters:
40 *    returns - pointer to the eventflags control block
41 *    *status - status
42 */
43
44RTEMS_INLINE_ROUTINE ITRON_Eventflags_Control *_ITRON_Eventflags_Allocate(
45  ID   flgid
46)
47{
48  return (ITRON_Eventflags_Control *)_ITRON_Objects_Allocate_by_index(
49    &_ITRON_Eventflags_Information,
50    flgid,
51    sizeof(ITRON_Eventflags_Control)
52  );
53}
54
55/*
56 *  _ITRON_Eventflags_Clarify_allocation_id_error
57 *
58 *  This function is invoked when an object allocation ID error
59 *  occurs to determine the specific ITRON error code to return.
60 */
61
62#define _ITRON_Eventflags_Clarify_allocation_id_error( _id ) \
63  _ITRON_Objects_Clarify_allocation_id_error( \
64      &_ITRON_Eventflags_Information, (_id) )
65
66/*
67 *  _ITRON_Eventflags_Clarify_get_id_error
68 *
69 *  This function is invoked when an object get ID error
70 *  occurs to determine the specific ITRON error code to return.
71 */
72
73#define _ITRON_Eventflags_Clarify_get_id_error( _id ) \
74 _ITRON_Objects_Clarify_get_id_error( &_ITRON_Eventflags_Information, (_id) )
75
76/*
77 *  _ITRON_Eventflags_Free
78 *
79 *  DESCRIPTION:
80 *
81 *  This routine frees a eventflags control block to the
82 *  inactive chain of free eventflags control blocks.
83 *
84 *  Input parameters:
85 *    the_eventflags - pointer to eventflags control block
86 *
87 *  Output parameters: NONE
88 */
89
90RTEMS_INLINE_ROUTINE void _ITRON_Eventflags_Free (
91  ITRON_Eventflags_Control *the_eventflags
92)
93{
94  _ITRON_Objects_Free( &_ITRON_Eventflags_Information, &the_eventflags->Object );
95}
96
97/*PAGE
98 *
99 *  _ITRON_Eventflags_Get
100 *
101 *  DESCRIPTION:
102 *
103 *  This function maps eventflags IDs to eventflags control blocks.
104 *  If ID corresponds to a local eventflags, then it returns
105 *  the_eventflags control pointer which maps to ID and location
106 *  is set to OBJECTS_LOCAL.  if the eventflags ID is global and
107 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
108 *  and the_eventflags is undefined.  Otherwise, location is set
109 *  to OBJECTS_ERROR and the_eventflags is undefined.
110 *
111 *  Input parameters:
112 *    id            - ITRON eventflags ID.
113 *    the_location  - pointer to a location variable
114 *
115 *  Output parameters:
116 *    *the_location  - location of the object
117 */
118
119RTEMS_INLINE_ROUTINE ITRON_Eventflags_Control *_ITRON_Eventflags_Get (
120  ID                 id,
121  Objects_Locations *location
122)
123{
124  return (ITRON_Eventflags_Control *)
125    _ITRON_Objects_Get( &_ITRON_Eventflags_Information, id, location );
126}
127
128/*PAGE
129 *
130 *  _ITRON_Eventflags_Is_null
131 *
132 *  This function returns TRUE if the_eventflags is NULL and FALSE otherwise.
133 *
134 *  Input parameters:
135 *    the_eventflags - pointer to eventflags control block
136 *
137 *  Output parameters:
138 *    TRUE  - if the_eventflags is NULL
139 *    FALSE - otherwise
140 */
141
142RTEMS_INLINE_ROUTINE bool _ITRON_Eventflags_Is_null (
143  ITRON_Eventflags_Control *the_eventflags
144)
145{
146  return ( the_eventflags == NULL );
147}
148
149/* 
150 *  XXX insert inline routines here
151 */
152
153#ifdef __cplusplus
154}
155#endif
156
157#endif
158/* end of include file */
159
Note: See TracBrowser for help on using the repository browser.