source: rtems/c/src/exec/rtems/inline/rtems/rtems/attr.inl @ 5283cc82

4.104.114.84.95
Last change on this file since 5283cc82 was 7d91d72, checked in by Joel Sherrill <joel.sherrill@…>, on 12/13/99 at 15:29:20

First attempt at adding simple binary semaphore in addition to the current
"mutex" and counting semaphore. This is at the request of Eric Norum
and his EPICS porting effort.

  • Property mode set to 100644
File size: 3.9 KB
Line 
1/*  inline/attr.inl
2 *
3 *  This include file contains all of the inlined routines associated
4 *  with attributes.
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.OARcorp.com/rtems/license.html.
12 *
13 *  $Id$
14 */
15
16#ifndef __INLINE_ATTRIBUTES_inl
17#define __INLINE_ATTRIBUTES_inl
18
19/*PAGE
20 *
21 *  _Attributes_Set
22 *
23 *  DESCRIPTION:
24 *
25 *  This function sets the requested new_attributes in the attribute_set
26 *  passed in.  The result is returned to the user.
27 */
28
29RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Set (
30   rtems_attribute new_attributes,
31   rtems_attribute attribute_set
32)
33{
34  return attribute_set | new_attributes;
35}
36
37/*PAGE
38 *
39 *  _Attributes_Clear
40 *
41 *  DESCRIPTION:
42 *
43 *  This function clears the requested new_attributes in the attribute_set
44 *  passed in.  The result is returned to the user.
45 */
46
47RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Clear (
48   rtems_attribute attribute_set,
49   rtems_attribute mask
50)
51{
52  return attribute_set & ~mask;
53}
54
55/*PAGE
56 *
57 *  _Attributes_Is_floating_point
58 *
59 *  DESCRIPTION:
60 *
61 *  This function returns TRUE if the floating point attribute is
62 *  enabled in the attribute_set and FALSE otherwise.
63 */
64
65RTEMS_INLINE_ROUTINE boolean _Attributes_Is_floating_point(
66  rtems_attribute attribute_set
67)
68{
69   return ( attribute_set & RTEMS_FLOATING_POINT );
70}
71
72/*PAGE
73 *
74 *  _Attributes_Is_global
75 *
76 *  DESCRIPTION:
77 *
78 *  This function returns TRUE if the global object attribute is
79 *  enabled in the attribute_set and FALSE otherwise.
80 */
81
82#if defined(RTEMS_MULTIPROCESSING)
83RTEMS_INLINE_ROUTINE boolean _Attributes_Is_global(
84  rtems_attribute attribute_set
85)
86{
87   return ( attribute_set & RTEMS_GLOBAL );
88}
89#endif
90
91/*PAGE
92 *
93 *  _Attributes_Is_priority
94 *
95 *  DESCRIPTION:
96 *
97 *  This function returns TRUE if the priority attribute is
98 *  enabled in the attribute_set and FALSE otherwise.
99 */
100
101RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority(
102  rtems_attribute attribute_set
103)
104{
105   return ( attribute_set & RTEMS_PRIORITY );
106}
107
108/*PAGE
109 *
110 *  _Attributes_Is_binary_semaphore
111 *
112 *  DESCRIPTION:
113 *
114 *  This function returns TRUE if the binary semaphore attribute is
115 *  enabled in the attribute_set and FALSE otherwise.
116 */
117
118RTEMS_INLINE_ROUTINE boolean _Attributes_Is_binary_semaphore(
119  rtems_attribute attribute_set
120)
121{
122  return ( attribute_set & RTEMS_BINARY_SEMAPHORE );
123}
124
125/*PAGE
126 *
127 *  _Attributes_Is_inherit_priority
128 *
129 *  DESCRIPTION:
130 *
131 *  This function returns TRUE if the priority inheritance attribute
132 *  is enabled in the attribute_set and FALSE otherwise.
133 */
134
135RTEMS_INLINE_ROUTINE boolean _Attributes_Is_inherit_priority(
136  rtems_attribute attribute_set
137)
138{
139   return ( attribute_set & RTEMS_INHERIT_PRIORITY );
140}
141
142/*PAGE
143 *
144 *  _Attributes_Is_priority_ceiling
145 *
146 *  DESCRIPTION:
147 *
148 *  This function returns TRUE if the priority ceiling attribute
149 *  is enabled in the attribute_set and FALSE otherwise.
150 */
151 
152RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority_ceiling(
153  rtems_attribute attribute_set
154)
155{
156   return ( attribute_set & RTEMS_PRIORITY_CEILING );
157}
158
159/*PAGE
160 *
161 *  _Attributes_Is_nesting_allowed
162 *
163 *  DESCRIPTION:
164 *
165 *  This function returns TRUE if the nesting allowed attribute
166 *  is enabled in the attribute_set and FALSE otherwise.
167 */
168 
169RTEMS_INLINE_ROUTINE boolean _Attributes_Is_nesting_allowed(
170  rtems_attribute attribute_set
171)
172{
173   return ( !(attribute_set & RTEMS_NO_NESTING_ALLOWED) );
174}
175
176/*PAGE
177 *
178 *  _Attributes_Is_system_task
179 *
180 *  DESCRIPTION:
181 *
182 *  This function returns TRUE if the system task attribute
183 *  is enabled in the attribute_set and FALSE otherwise.
184 */
185 
186RTEMS_INLINE_ROUTINE boolean _Attributes_Is_system_task(
187  rtems_attribute attribute_set
188)
189{
190   return ( attribute_set & RTEMS_PRIORITY_CEILING );
191}
192
193#endif
194/* end of include file */
Note: See TracBrowser for help on using the repository browser.